X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=modules%2Fmunin-node%2Fmanifests%2Finit.pp;h=d70ffdc0f9600021d9de015937d241e5e94e5226;hb=59895548c1eb3504b073e5bc648faa6d3f96b6e6;hp=f0fff2aaec92f8dda37d2c7f866d9dc2861bbcb1;hpb=1dcbe2cfccccd5ecabbb66c4703acca7c92a93a3;p=mirror%2Fdsa-puppet.git diff --git a/modules/munin-node/manifests/init.pp b/modules/munin-node/manifests/init.pp index f0fff2aae..d70ffdc0f 100644 --- a/modules/munin-node/manifests/init.pp +++ b/modules/munin-node/manifests/init.pp @@ -1,15 +1,68 @@ +define activate_munin_check($ensure=present, script=$name) { + case $script { + "": { $base = $name } + default: { $base = $script } + } + + case $ensure { + present: { + file { "/etc/munin/plugins/$name": + ensure => "/usr/share/munin/plugins/$base", + notify => Exec["munin-node restart"]; + } + } + default: { + file { "/etc/munin/plugins/$name": + ensure => $ensure, + notify => Exec["munin-node restart"]; + } + } + } +} + class munin-node { - package { munin-node: ensure => latest } + package { munin-node: ensure => installed } + + activate_munin_check { + "cpu":; + "df":; + "df_abs":; + "df_inode":; + "entropy":; + "forks":; + "interrupts":; + "iostat":; + "irqstats":; + "load":; + "memory":; + "ntp_offset":; + "ntp_states":; + "open_files":; + "open_inodes":; + "processes":; + "swap":; + "uptime":; + "vmstat":; + } + + case $spamd { + "true": { + activate_munin_check { "spamassassin":; } + } + } + + file { + "/etc/munin/munin-node.conf": + source => [ "puppet:///munin-node/per-host/$fqdn/munin-node.conf", + "puppet:///munin-node/common/munin-node.conf" ], + require => Package["munin-node"], + notify => Exec["munin-node restart"]; - file { "/etc/munin/munin-node.conf": - owner => root, - group => root, - mode => 664, - source => [ "puppet:///munin-node/per-host/$fqdn/munin-node.conf", - "puppet:///munin-node/common/munin-node.conf" ], - require => Package["munin-node"], - notify => Exec["munin-node restart"], + "/etc/munin/plugin-conf.d/munin-node": + content => template("munin-node/munin-node.plugin.conf.erb"), + require => Package["munin-node"], + notify => Exec["munin-node restart"]; } exec { "munin-node restart":