summaryrefslogtreecommitdiff
path: root/manifests/server/munin/default.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/server/munin/default.pp')
-rw-r--r--manifests/server/munin/default.pp23
1 files changed, 23 insertions, 0 deletions
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'] ]
+ }
+}