]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/munin-node/manifests/init.pp
make the munin check allow for removals as well
[dsa-puppet.git] / modules / munin-node / manifests / init.pp
1 define activate_munin_check($ensure=present) {
2     case $ensure {
3         present: {
4             file { "/etc/munin/plugins/$name":
5                      ensure => "/usr/share/munin/plugins/$name",
6                      notify => Exec["munin-node restart"];
7             }
8         }
9         default: {
10             file { "/etc/munin/plugins/$name":
11                      ensure => $ensure,
12                      notify => Exec["munin-node restart"];
13             }
14         }
15 }
16
17 class munin-node {
18
19     package { munin-node: ensure => installed }
20
21     activate_munin_check {
22         "cpu":;
23         "df":;
24         "df_inode":;
25         "entropy":;
26         "forks":;
27         "interrupts":;
28         "iostat":;
29         "irqstats":;
30         "load":;
31         "memory":;
32         "ntp_offset":;
33         "open_files":;
34         "open_inodes":;
35         "processes":;
36         "swap":;
37         "vmstat":;
38     }
39
40     file { "/etc/munin/munin-node.conf":
41         source  => [ "puppet:///munin-node/per-host/$fqdn/munin-node.conf",
42                      "puppet:///munin-node/common/munin-node.conf" ],
43         require => Package["munin-node"],
44         notify  => Exec["munin-node restart"],
45     }
46
47     exec { "munin-node restart":
48         path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
49         refreshonly => true,
50     }
51 }
52