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