]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/munin-node/manifests/init.pp
add uptime plugin
[dsa-puppet.git] / modules / munin-node / manifests / init.pp
1 define activate_munin_check($ensure=present, script=$name) {
2     case $ensure {
3         present: {
4             file { "/etc/munin/plugins/$name":
5                      ensure => "/usr/share/munin/plugins/$script",
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
18 class munin-node {
19
20     package { munin-node: ensure => installed }
21
22     activate_munin_check {
23         "cpu":;
24         "df":;
25         "df_abs":;
26         "df_inode":;
27         "entropy":;
28         "forks":;
29         "interrupts":;
30         "iostat":;
31         "irqstats":;
32         "load":;
33         "memory":;
34         "ntp_offset":;
35         "open_files":;
36         "open_inodes":;
37         "processes":;
38         "swap":;
39         "uptime":;
40         "vmstat":;
41     }
42
43     file { "/etc/munin/munin-node.conf":
44         source  => [ "puppet:///munin-node/per-host/$fqdn/munin-node.conf",
45                      "puppet:///munin-node/common/munin-node.conf" ],
46         require => Package["munin-node"],
47         notify  => Exec["munin-node restart"],
48     }
49
50     exec { "munin-node restart":
51         path        => "/etc/init.d:/usr/bin:/usr/sbin:/bin:/sbin",
52         refreshonly => true,
53     }
54 }
55