From aa8da42f01d26e184ec110840723355953c42b00 Mon Sep 17 00:00:00 2001 From: Wouter Schoot Date: Mon, 24 Jun 2013 16:19:19 +0200 Subject: Changed include to ordering to prevent duplicate inclusions --- manifests/plugins/setup.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp index 197b657..96891d3 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -1,7 +1,7 @@ class munin::plugins::setup { # This is required for the munin-node service and package requirements below. - include munin::client + Class['munin::client'] -> Class['munin::plugins::setup'] file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: -- cgit v1.2.3 From aaf55c9ebfa0e34f63b2ca3c2b660e1d164026dd Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Mon, 6 May 2013 18:13:12 +0200 Subject: lintify --- manifests/plugins/base.pp | 16 ++++++++++------ manifests/plugins/centos.pp | 5 ++++- manifests/plugins/debian.pp | 1 + manifests/plugins/djbdns.pp | 5 +++-- manifests/plugins/dom0.pp | 1 + manifests/plugins/gentoo.pp | 3 ++- manifests/plugins/interfaces.pp | 30 +++++++++++++----------------- manifests/plugins/kvm.pp | 1 + manifests/plugins/linux.pp | 7 ++++--- manifests/plugins/muninhost.pp | 3 ++- manifests/plugins/openbsd.pp | 5 +++-- manifests/plugins/physical.pp | 6 ++++-- manifests/plugins/selinux.pp | 1 + manifests/plugins/setup.pp | 5 +++-- manifests/plugins/vserver.pp | 4 ++-- 15 files changed, 54 insertions(+), 39 deletions(-) (limited to 'manifests/plugins') 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 index 60c706c..0bb7697 100644 --- a/manifests/plugins/centos.pp +++ b/manifests/plugins/centos.pp @@ -1,3 +1,6 @@ +# Install munin plugins for centos class munin::plugins::centos inherits munin::plugins::base { - munin::plugin { users: ensure => present; } + 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 da89ed0..b92802b 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 { + + $if_err_plugin = $::operatingsystem ? { + 'openbsd' => 'if_errcoll_', + default => 'if_err_', + } # 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+|__tmp\d+') - $ifs = regsubst($real_ifs, '(.+)', "if_\\1") + $ifs = regsubst($real_ifs, '(.+)', 'if_\1') + $if_errs = regsubst($real_ifs, '(.+)', "${if_err_plugin}\1") - munin::plugin { - $ifs: ensure => 'if_'; + munin::plugin { $ifs: + ensure => 'if_', } - 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_'; - } - } + + 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..57f2bba 100644 --- a/manifests/plugins/linux.pp +++ b/manifests/plugins/linux.pp @@ -1,8 +1,9 @@ -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' ]: 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..e6210e9 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -1,3 +1,4 @@ +# Set up the munin plugins for a node class munin::plugins::setup { # This is required for the munin-node service and package requirements below. @@ -5,10 +6,10 @@ class munin::plugins::setup { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: - ignore => 'snmp_*', ensure => directory, + ignore => 'snmp_*', checksum => mtime, - recurse => true, + recurse => true, purge => true, force => true, notify => Service['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; } } - -- cgit v1.2.3 From 26224742940b06335bca3cb8f5e09d0c0a5cabef Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Sun, 13 Oct 2013 20:24:20 +0200 Subject: Class[] -> Class[] requirement replaced by an anchor --- manifests/plugins/setup.pp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp index e0826f0..e1a57d9 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -1,12 +1,10 @@ # Set up the munin plugins for a node class munin::plugins::setup { - # This is required for the munin-node service and package requirements below. - Class['munin::client'] -> Class['munin::plugins::setup'] - file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: ensure => directory, + require => Anchor['munin::client::installed'], ignore => 'snmp_*', checksum => mtime, recurse => true, @@ -18,6 +16,7 @@ class munin::plugins::setup { mode => '0755'; '/etc/munin/plugin-conf.d/munin-node': ensure => present, + require => Anchor['munin::client::installed'], notify => Service['munin-node'], owner => root, group => 0, -- cgit v1.2.3 From d2a2cb77b9a9ca5deddecdec3d14ac763388929e Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Nov 2013 17:46:46 +0100 Subject: cleanup openbsd manual installation + remove unnecessary files The manual OpenBSD installation is now so old and not needed anymore. --- manifests/plugins/centos.pp | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 manifests/plugins/centos.pp (limited to 'manifests/plugins') diff --git a/manifests/plugins/centos.pp b/manifests/plugins/centos.pp deleted file mode 100644 index 0bb7697..0000000 --- a/manifests/plugins/centos.pp +++ /dev/null @@ -1,6 +0,0 @@ -# Install munin plugins for centos -class munin::plugins::centos inherits munin::plugins::base { - munin::plugin { 'users': - ensure => present, - } -} -- cgit v1.2.3 From 03c50709169ee38cd5d759c461389b2a476fcc64 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Nov 2013 17:52:36 +0100 Subject: use rather the stdlib prefix function than the good old regsubst hack --- manifests/plugins/interfaces.pp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index b92802b..b795bc0 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,15 +1,16 @@ # handle if_ and if_err_ plugins 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+|__tmp\d+') + + $ifs = prefix($real_ifs, 'if_') + $if_err_plugin = $::operatingsystem ? { 'openbsd' => 'if_errcoll_', default => 'if_err_', } - - # 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+|__tmp\d+') - $ifs = regsubst($real_ifs, '(.+)', 'if_\1') - $if_errs = regsubst($real_ifs, '(.+)', "${if_err_plugin}\1") + $if_errs = prefix($real_ifs, $if_err_plugin) munin::plugin { $ifs: ensure => 'if_', -- cgit v1.2.3 From ad37140f6123c0e85cfbeb23dee5b3ea3c324701 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Nov 2013 17:55:54 +0100 Subject: remove anchor dependency - fixed #26 given that all os are using package installation now, we can replace the anchor with the package dependency. It also caused a dependency cycle as the anchor was for the whole class and not only the package installation. --- manifests/plugins/setup.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp index e1a57d9..23222ec 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -4,7 +4,7 @@ class munin::plugins::setup { file { [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: ensure => directory, - require => Anchor['munin::client::installed'], + require => Package['munin-node'], ignore => 'snmp_*', checksum => mtime, recurse => true, @@ -16,7 +16,7 @@ class munin::plugins::setup { mode => '0755'; '/etc/munin/plugin-conf.d/munin-node': ensure => present, - require => Anchor['munin::client::installed'], + require => Package['munin-node'], notify => Service['munin-node'], owner => root, group => 0, -- cgit v1.2.3 From d92912ba27c1234e6f6072a3b922beabbd28dd98 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Nov 2013 18:28:30 +0100 Subject: remove unnecessary dependencies --- manifests/plugins/setup.pp | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/setup.pp b/manifests/plugins/setup.pp index 23222ec..a3f3b22 100644 --- a/manifests/plugins/setup.pp +++ b/manifests/plugins/setup.pp @@ -16,22 +16,9 @@ class munin::plugins::setup { mode => '0755'; '/etc/munin/plugin-conf.d/munin-node': ensure => present, - require => Package['munin-node'], notify => Service['munin-node'], owner => root, 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'], - } - } - } } -- cgit v1.2.3 From a161f0cd19a4e099bc8bb4bb3e01898c9c5f2ee7 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Nov 2013 18:43:23 +0100 Subject: add a few more intelligent plugins for linux hosts --- manifests/plugins/linux.pp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp index 57f2bba..354d23c 100644 --- a/manifests/plugins/linux.pp +++ b/manifests/plugins/linux.pp @@ -1,7 +1,8 @@ # 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': ensure => $::acpi_available; -- cgit v1.2.3 From 7e03247a9e219fe8e57d544957eb06e305e69fc1 Mon Sep 17 00:00:00 2001 From: intrigeri Date: Fri, 5 Dec 2014 20:07:47 +0000 Subject: Ignore vnet\d+ network interfaces, just like veth, virbr etc. --- manifests/plugins/interfaces.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index da89ed0..c57e887 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -2,7 +2,7 @@ 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+|__tmp\d+') + $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") munin::plugin { -- cgit v1.2.3 From 6d7494bfe90819273bb6343911f410071b5561a8 Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Tue, 24 Feb 2015 11:25:56 -0500 Subject: Add class parameter to allow customisation of if plugin filter --- manifests/plugins/interfaces.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index 35b41fd..2bbc1c6 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -2,7 +2,7 @@ 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+') + $real_ifs = reject(split($::interfaces, ' |,'), $munin::if_filter) $ifs = prefix($real_ifs, 'if_') $if_err_plugin = $::operatingsystem ? { -- cgit v1.2.3