From 38d8bd2bdafa5db9e6fc064a86e388958c1c70d9 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Fri, 11 Dec 2009 11:34:03 -0500 Subject: manage mysql munin plugin per-OS, use debian.cnf on Debian --- manifests/server/munin/debian.pp | 9 +++++++++ manifests/server/munin/default.pp | 23 +++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 manifests/server/munin/debian.pp create mode 100644 manifests/server/munin/default.pp (limited to 'manifests/server/munin') diff --git a/manifests/server/munin/debian.pp b/manifests/server/munin/debian.pp new file mode 100644 index 0000000..2b2acb4 --- /dev/null +++ b/manifests/server/munin/debian.pp @@ -0,0 +1,9 @@ +# manifests/server/munin/debian.pp + +class mysql::server::munin::debian { + munin::plugin { + [mysql_bytes, mysql_queries, mysql_slowqueries, mysql_threads]: + config => "user root\nenv.mysqlopts --defaults-file=/etc/mysql/debian.cnf", + require => Package['mysql'], + } +} diff --git a/manifests/server/munin/default.pp b/manifests/server/munin/default.pp new file mode 100644 index 0000000..b60ff0d --- /dev/null +++ b/manifests/server/munin/default.pp @@ -0,0 +1,23 @@ +# manifests/server/munin/default.pp + +class mysql::server::munin::default { + 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"), + require => Package['mysql'], + } + + mysql_grant{'munin@localhost': + privileges => 'select_priv', + require => [ Mysql_user['munin@localhost'], Package['mysql'] ], + } + + 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'] ] + } +} -- cgit v1.2.3