-define activate_munin_check($script) {
- file { "/etc/munin/plugins/$script":
- ensure => "/usr/share/munin/plugins/$script"
- notify => Exec["munin-node restart"];
+define activate_munin_check($ensure=present) {
+ case $ensure {
+ present: {
+ file { "/etc/munin/plugins/$name":
+ ensure => "/usr/share/munin/plugins/$name",
+ 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 => installed }
+ activate_munin_check {
+ "cpu":;
+ "df":;
+ "df_inode":;
+ "entropy":;
+ "forks":;
+ "interrupts":;
+ "iostat":;
+ "irqstats":;
+ "load":;
+ "memory":;
+ "ntp_offset":;
+ "open_files":;
+ "open_inodes":;
+ "processes":;
+ "swap":;
+ "vmstat":;
+ }
+
file { "/etc/munin/munin-node.conf":
source => [ "puppet:///munin-node/per-host/$fqdn/munin-node.conf",
"puppet:///munin-node/common/munin-node.conf" ],