module-mysql/manifests/server/munin/default.pp

40 lines
1.2 KiB
ObjectPascal
Raw Normal View History

# manifests/server/munin/default.pp
2008-06-13 22:16:32 +02:00
class mysql::server::munin::default {
2010-12-21 22:10:34 +01:00
case $munin_mysql_password {
'': { fail("please specify \$munin_mysql_password to enable mysql munin plugin")}
}
2008-06-13 22:16:32 +02:00
2010-12-21 22:10:34 +01:00
mysql_user{'munin@localhost':
password_hash => mysql_password("$munin_mysql_password"),
require => Package['mysql'],
}
2008-06-13 22:16:32 +02:00
2010-12-21 22:10:34 +01:00
mysql_grant{'munin@localhost':
privileges => 'select_priv',
require => [ Mysql_user['munin@localhost'], Package['mysql'] ],
}
2008-06-13 22:16:32 +02:00
2010-12-21 22:10:34 +01:00
munin::plugin {
[mysql_bytes, mysql_queries, mysql_slowqueries, mysql_threads]:
config => "env.mysqlopts --user=munin --password=${munin_mysql_password} -h localhost",
require => [ Mysql_grant['munin@localhost'], Mysql_user['munin@localhost'], Package['mysql'] ]
}
Munin::Plugin::Deploy{
config => "env.mysqlopts --user=munin --password=$munin_mysql_password -h localhost",
require =>
[ Mysql_grant['munin@localhost'],
Mysql_user['munin@localhost'],
Package['mysql'] ]
}
munin::plugin::deploy{
'mysql_connections':
source => 'mysql/munin/mysql_connections';
'mysql_qcache':
source => 'mysql/munin/mysql_qcache';
'mysql_qcache_mem':
source => 'mysql/munin/mysql_qcache_mem';
}
2008-06-13 22:16:32 +02:00
}