2009-12-11 17:34:03 +01:00
|
|
|
# manifests/server/munin/default.pp
|
2008-06-13 22:16:32 +02:00
|
|
|
|
2009-12-11 17:34:03 +01:00
|
|
|
class mysql::server::munin::default {
|
2008-06-13 22:16:32 +02:00
|
|
|
case $munin_mysql_password {
|
|
|
|
'': { fail("please specify \$munin_mysql_password to enable mysql munin plugin")}
|
|
|
|
}
|
|
|
|
|
|
|
|
mysql_user{'munin@localhost':
|
|
|
|
password_hash => mysql_password("$munin_mysql_password"),
|
2008-07-01 20:29:30 +02:00
|
|
|
require => Package['mysql'],
|
2008-06-13 22:16:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
mysql_grant{'munin@localhost':
|
|
|
|
privileges => 'select_priv',
|
2008-07-01 20:29:30 +02:00
|
|
|
require => [ Mysql_user['munin@localhost'], Package['mysql'] ],
|
2008-06-13 22:16:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
munin::plugin {
|
|
|
|
[mysql_bytes, mysql_queries, mysql_slowqueries, mysql_threads]:
|
2008-07-13 17:19:49 +02:00
|
|
|
config => "env.mysqlopts --user=munin --password=${munin_mysql_password} -h localhost",
|
2008-07-01 20:29:30 +02:00
|
|
|
require => [ Mysql_grant['munin@localhost'], Mysql_user['munin@localhost'], Package['mysql'] ]
|
2008-06-13 22:16:32 +02:00
|
|
|
}
|
|
|
|
}
|