diff options
Diffstat (limited to 'manifests/munin.pp')
-rw-r--r-- | manifests/munin.pp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/manifests/munin.pp b/manifests/munin.pp new file mode 100644 index 0000000..a7a862e --- /dev/null +++ b/manifests/munin.pp @@ -0,0 +1,22 @@ +# manifests/munin.pp + +class mysql::munin { + 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"), + } + + mysql_grant{'munin@localhost': + privileges => 'select_priv', + require => Mysql_user['munin@localhost'], + } + + 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'] ] + } +} |