diff options
Diffstat (limited to 'manifests/plugins')
-rw-r--r-- | manifests/plugins/base.pp | 16 | ||||
-rw-r--r-- | manifests/plugins/centos.pp | 3 | ||||
-rw-r--r-- | manifests/plugins/debian.pp | 1 | ||||
-rw-r--r-- | manifests/plugins/djbdns.pp | 5 | ||||
-rw-r--r-- | manifests/plugins/dom0.pp | 1 | ||||
-rw-r--r-- | manifests/plugins/gentoo.pp | 3 | ||||
-rw-r--r-- | manifests/plugins/interfaces.pp | 30 | ||||
-rw-r--r-- | manifests/plugins/kvm.pp | 1 | ||||
-rw-r--r-- | manifests/plugins/linux.pp | 8 | ||||
-rw-r--r-- | manifests/plugins/muninhost.pp | 3 | ||||
-rw-r--r-- | manifests/plugins/openbsd.pp | 5 | ||||
-rw-r--r-- | manifests/plugins/physical.pp | 6 | ||||
-rw-r--r-- | manifests/plugins/selinux.pp | 1 | ||||
-rw-r--r-- | manifests/plugins/setup.pp | 21 | ||||
-rw-r--r-- | manifests/plugins/vserver.pp | 4 |
15 files changed, 52 insertions, 56 deletions
diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp index c6b88ed..33cd84d 100644 --- a/manifests/plugins/base.pp +++ b/manifests/plugins/base.pp @@ -1,29 +1,33 @@ +# A basic set of plugins class munin::plugins::base { # setup basic plugins munin::plugin { - [ df, cpu, interrupts, load, memory, netstat, open_files, - processes, swap, uptime, users, vmstat ]: + [ 'df', 'cpu', 'interrupts', 'load', 'memory', 'netstat', 'open_files', + 'processes', 'swap', 'uptime', 'users', 'vmstat' ]: ensure => present, } file{'/etc/munin/plugin-conf.d/df': content => "[df*]\nenv.exclude none unknown iso9660 squashfs udf romfs ramfs debugfs binfmt_misc rpc_pipefs fuse.gvfs-fuse-daemon\n", - require => Munin::Plugin[df], - owner => root, group => 0, mode => 0644; + require => Munin::Plugin['df'], + owner => 'root', + group => 0, + mode => '0644', } include munin::plugins::interfaces case $::kernel { openbsd: { include munin::plugins::openbsd } linux: { - case $vserver { + case $::vserver { guest: { include munin::plugins::vserver } default: { include munin::plugins::linux } } } } - + case $::virtual { physical: { include munin::plugins::physical } xen0: { include munin::plugins::dom0 } + default: { } } } diff --git a/manifests/plugins/centos.pp b/manifests/plugins/centos.pp deleted file mode 100644 index 60c706c..0000000 --- a/manifests/plugins/centos.pp +++ /dev/null @@ -1,3 +0,0 @@ -class munin::plugins::centos inherits munin::plugins::base { - munin::plugin { users: ensure => present; } -} diff --git a/manifests/plugins/debian.pp b/manifests/plugins/debian.pp index f756150..efa922b 100644 --- a/manifests/plugins/debian.pp +++ b/manifests/plugins/debian.pp @@ -1 +1,2 @@ +# Debian specific plugins class munin::plugins::debian { } diff --git a/manifests/plugins/djbdns.pp b/manifests/plugins/djbdns.pp index c0a5163..de3936b 100644 --- a/manifests/plugins/djbdns.pp +++ b/manifests/plugins/djbdns.pp @@ -1,3 +1,4 @@ -class munin::plugins::djbdns { - munin::plugin::deploy { "tinydns": } +# Set up the djbdns plugin +class munin::plugins::djbdns { + munin::plugin::deploy { 'tinydns': } } diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp index 44995fc..98aee1d 100644 --- a/manifests/plugins/dom0.pp +++ b/manifests/plugins/dom0.pp @@ -1,3 +1,4 @@ +# Set up plugins for a Xen dom0 host class munin::plugins::dom0 { munin::plugin::deploy { [ 'xen', 'xen_cpu', 'xen_memory', 'xen_mem', diff --git a/manifests/plugins/gentoo.pp b/manifests/plugins/gentoo.pp index 27d4689..36f2370 100644 --- a/manifests/plugins/gentoo.pp +++ b/manifests/plugins/gentoo.pp @@ -1,4 +1,5 @@ -class munin::plugins::gentoo { +# Set up the plugins for a gentoo host +class munin::plugins::gentoo { munin::plugin::deploy { 'gentoo_lastupdated': config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep" } diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index c57e887..35b41fd 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,25 +1,21 @@ # handle if_ and if_err_ plugins -class munin::plugins::interfaces { +class munin::plugins::interfaces { # filter out many of the useless interfaces that show up $real_ifs = reject(split($::interfaces, ' |,'), 'eth\d+_\d+|sit0|virbr\d+_nic|vif\d+_\d+|veth\d+|vnet\d+|__tmp\d+') - $ifs = regsubst($real_ifs, '(.+)', "if_\\1") + $ifs = prefix($real_ifs, 'if_') - munin::plugin { - $ifs: ensure => 'if_'; + $if_err_plugin = $::operatingsystem ? { + 'openbsd' => 'if_errcoll_', + default => 'if_err_', } - case $::operatingsystem { - openbsd: { - $if_errs = regsubst($real_ifs, '(.+)', "if_errcoll_\\1") - munin::plugin{ - $if_errs: ensure => 'if_errcoll_'; - } - } - default: { - $if_errs = regsubst($real_ifs, '(.+)', "if_err_\\1") - munin::plugin{ - $if_errs: ensure => 'if_err_'; - } - } + $if_errs = prefix($real_ifs, $if_err_plugin) + + munin::plugin { $ifs: + ensure => 'if_', + } + + munin::plugin { $if_errs: + ensure => $if_err_plugin, } } diff --git a/manifests/plugins/kvm.pp b/manifests/plugins/kvm.pp index 7a1430f..650e5ef 100644 --- a/manifests/plugins/kvm.pp +++ b/manifests/plugins/kvm.pp @@ -1,3 +1,4 @@ +# Set up munin plugins for a KVM host class munin::plugins::kvm { munin::plugin::deploy { [ 'kvm_cpu', 'kvm_mem', 'kvm_net' ]:; diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp index a73de63..354d23c 100644 --- a/manifests/plugins/linux.pp +++ b/manifests/plugins/linux.pp @@ -1,8 +1,10 @@ -class munin::plugins::linux { +# Set up plugins for a linux host +class munin::plugins::linux { munin::plugin { - [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]: + [ 'df_abs', 'forks', 'df_inode', 'irqstats', 'entropy', 'open_inodes', + 'diskstats', 'proc_pri', 'threads', ]: ensure => present; - acpi: + 'acpi': ensure => $::acpi_available; } } diff --git a/manifests/plugins/muninhost.pp b/manifests/plugins/muninhost.pp index e4fb87d..644adb6 100644 --- a/manifests/plugins/muninhost.pp +++ b/manifests/plugins/muninhost.pp @@ -1,3 +1,4 @@ -class munin::plugins::muninhost { +# Set up the plugins for a munin host +class munin::plugins::muninhost { munin::plugin { ['munin_update', 'munin_graph']: } } diff --git a/manifests/plugins/openbsd.pp b/manifests/plugins/openbsd.pp index b549994..c195a1d 100644 --- a/manifests/plugins/openbsd.pp +++ b/manifests/plugins/openbsd.pp @@ -1,6 +1,7 @@ -class munin::plugins::openbsd { +# Set up the plugins for an openbsd host +class munin::plugins::openbsd { munin::plugin { - [ memory_pools, memory_types ]: + [ 'memory_pools', 'memory_types' ]: ensure => present, } } diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp index a1c27a7..b04845c 100644 --- a/manifests/plugins/physical.pp +++ b/manifests/plugins/physical.pp @@ -1,5 +1,7 @@ -class munin::plugins::physical { +# Set up the plugins for a physical machine +class munin::plugins::physical { case $::kernel { - linux: { munin::plugin { iostat: } } + linux: { munin::plugin { 'iostat': } } + default: {} } } diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp index d094f35..9e03f0a 100644 --- a/manifests/plugins/selinux.pp +++ b/manifests/plugins/selinux.pp @@ -1,3 +1,4 @@ +# SELinux specific plugins class munin::plugins::selinux { munin::plugin{ [ 'selinux_avcstat' ]: } } diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp index 197b657..a3f3b22 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -1,14 +1,13 @@ +# Set up the munin plugins for a node class munin::plugins::setup { - # This is required for the munin-node service and package requirements below. - include munin::client - file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: - ignore => 'snmp_*', ensure => directory, + require => Package['munin-node'], + ignore => 'snmp_*', checksum => mtime, - recurse => true, + recurse => true, purge => true, force => true, notify => Service['munin-node'], @@ -22,16 +21,4 @@ class munin::plugins::setup { group => 0, mode => '0640'; } - case $::kernel { - openbsd: { - File['/etc/munin/plugin-conf.d/munin-node']{ - before => File['/var/run/munin'], - } - } - default: { - File['/etc/munin/plugin-conf.d/munin-node']{ - before => Package['munin-node'], - } - } - } } diff --git a/manifests/plugins/vserver.pp b/manifests/plugins/vserver.pp index e3eec05..5dc6431 100644 --- a/manifests/plugins/vserver.pp +++ b/manifests/plugins/vserver.pp @@ -1,7 +1,7 @@ +# vserver specific plugins class munin::plugins::vserver { munin::plugin { - [ netstat, processes ]: + [ 'netstat', 'processes' ]: ensure => present; } } - |