From 74f66a8e77b153552ef52efee03187320e1ce877 Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 10 Dec 2010 16:48:01 -0500 Subject: standardize formatting --- manifests/plugins/apache.pp | 10 +++-- manifests/plugins/base.pp | 91 ++++++++++++++++++++++------------------- manifests/plugins/dom0.pp | 15 +++---- manifests/plugins/gentoo.pp | 4 +- manifests/plugins/interfaces.pp | 32 +++++++-------- manifests/plugins/linux.pp | 16 ++++---- manifests/plugins/openbsd.pp | 14 +++---- manifests/plugins/physical.pp | 8 ++-- manifests/plugins/selinux.pp | 6 ++- manifests/plugins/vserver.pp | 10 +++-- 10 files changed, 110 insertions(+), 96 deletions(-) (limited to 'manifests/plugins') diff --git a/manifests/plugins/apache.pp b/manifests/plugins/apache.pp index ee90de8..030e7e6 100644 --- a/manifests/plugins/apache.pp +++ b/manifests/plugins/apache.pp @@ -1,6 +1,8 @@ class munin::plugins::apache inherits munin::plugins::base { - munin::plugin{ "apache_accesses": } - munin::plugin{ "apache_processes": } - munin::plugin{ "apache_volume": } - munin::plugin::deploy { "apache_activity": } + + munin::plugin{ "apache_accesses": } + munin::plugin{ "apache_processes": } + munin::plugin{ "apache_volume": } + munin::plugin::deploy { "apache_activity": } + } diff --git a/manifests/plugins/base.pp b/manifests/plugins/base.pp index 5fc2476..64756bc 100644 --- a/manifests/plugins/base.pp +++ b/manifests/plugins/base.pp @@ -1,50 +1,55 @@ class munin::plugins::base { - file { - [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: - source => "puppet://$server/modules/common/empty", - ignore => [ '\.ignore', 'snmp_*' ], - ensure => directory, checksum => mtime, - recurse => true, purge => true, force => true, - mode => 0755, owner => root, group => 0, - notify => Service['munin-node']; - '/etc/munin/plugin-conf.d/munin-node': - ensure => present, - mode => 0644, owner => root, group => 0, - notify => Service['munin-node'], - } - munin::plugin { - [ df, cpu, interrupts, load, memory, netstat, open_files, - processes, swap, uptime, vmstat - ]: - ensure => present, - } - include munin::plugins::interfaces + file { + [ '/etc/munin/plugins', '/etc/munin/plugin-conf.d' ]: + source => "puppet://$server/modules/common/empty", + ignore => [ '\.ignore', 'snmp_*' ], + ensure => directory, checksum => mtime, + recurse => true, purge => true, force => true, + mode => 0755, owner => root, group => 0, + notify => Service['munin-node']; - 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'], - } - } + '/etc/munin/plugin-conf.d/munin-node': + ensure => present, + mode => 0644, owner => root, group => 0, + notify => Service['munin-node'], + } + + munin::plugin { + [ df, cpu, interrupts, load, memory, netstat, open_files, + processes, swap, uptime, vmstat ]: + ensure => present, + } + + include munin::plugins::interfaces + + case $kernel { + openbsd: { + File['/etc/munin/plugin-conf.d/munin-node']{ + before => File['/var/run/munin'], + } } - case $kernel { - linux: { - case $vserver { - guest: { include munin::plugins::vserver } - default: { - include munin::plugins::linux - } - } - } + default: { + File['/etc/munin/plugin-conf.d/munin-node']{ + before => Package['munin-node'], + } } - case $virtual { - physical: { include munin::plugins::physical } - xen0: { include munin::plugins::dom0 } + } + + case $kernel { + linux: { + case $vserver { + guest: { include munin::plugins::vserver } + default: { + include munin::plugins::linux + } + } } + } + + case $virtual { + physical: { include munin::plugins::physical } + xen0: { include munin::plugins::dom0 } + } + } diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp index 8d919c3..3efc6bd 100644 --- a/manifests/plugins/dom0.pp +++ b/manifests/plugins/dom0.pp @@ -1,9 +1,10 @@ class munin::plugins::dom0 inherits munin::plugins::physical { - munin::plugin::deploy { "xen": config => "user root"} - munin::plugin::deploy { "xen-cpu": config => "user root"} - munin::plugin::deploy { "xen_memory": config => "user root"} - munin::plugin::deploy { "xen_mem": config => "user root"} - munin::plugin::deploy { "xen_vm": config => "user root"} - munin::plugin::deploy { "xen_vbd": config => "user root"} - munin::plugin::deploy { "xen_traffic_all": config => "user root"} + + munin::plugin::deploy { "xen": config => "user root"} + munin::plugin::deploy { "xen-cpu": config => "user root"} + munin::plugin::deploy { "xen_memory": config => "user root"} + munin::plugin::deploy { "xen_mem": config => "user root"} + munin::plugin::deploy { "xen_vm": config => "user root"} + munin::plugin::deploy { "xen_vbd": config => "user root"} + munin::plugin::deploy { "xen_traffic_all": config => "user root"} } diff --git a/manifests/plugins/gentoo.pp b/manifests/plugins/gentoo.pp index 81d0e6b..6d02a24 100644 --- a/manifests/plugins/gentoo.pp +++ b/manifests/plugins/gentoo.pp @@ -1,3 +1,5 @@ class munin::plugins::gentoo inherits munin::plugins::base { - munin::plugin::deploy { "gentoo_lastupdated": config => "user portage\nenv.logfile /var/log/emerge.log\nenv.tail /usr/bin/tail\nenv.grep /bin/grep"} + + 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 99b85ba..de4b75b 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,22 +1,22 @@ # handle if_ and if_err_ plugins class munin::plugins::interfaces inherits munin::plugins::base { + + $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") - $ifs = gsub(split($interfaces, " |,"), "(.+)", "if_\\1") - munin::plugin { - $ifs: ensure => "if_"; + munin::plugin { $ifs: ensure => "if_"; } + + case $operatingsystem { + openbsd: { + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") + munin::plugin{ + $if_errs: ensure => "if_errcoll_"; + } } - case $operatingsystem { - openbsd: { - $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") - munin::plugin{ - $if_errs: ensure => "if_errcoll_"; - } - } - default: { - $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") - munin::plugin{ - $if_errs: ensure => "if_err_"; - } - } + default: { + $if_errs = gsub(split($interfaces, " |,"), "(.+)", "if_err_\\1") + munin::plugin{ + $if_errs: ensure => "if_err_"; + } } + } } diff --git a/manifests/plugins/linux.pp b/manifests/plugins/linux.pp index c7beb59..5c6afe9 100644 --- a/manifests/plugins/linux.pp +++ b/manifests/plugins/linux.pp @@ -1,10 +1,12 @@ class munin::plugins::linux inherits munin::plugins::base { - munin::plugin { - [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]: - ensure => present; - acpi: - ensure => $acpi_available; - } - include munin::plugins::interfaces + munin::plugin { + [ df_abs, forks, df_inode, irqstats, entropy, open_inodes ]: + ensure => present; + acpi: + ensure => $acpi_available; + } + + include munin::plugins::interfaces + } diff --git a/manifests/plugins/openbsd.pp b/manifests/plugins/openbsd.pp index 67cf32d..feb71fb 100644 --- a/manifests/plugins/openbsd.pp +++ b/manifests/plugins/openbsd.pp @@ -1,13 +1,9 @@ class munin::plugins::openbsd inherits munin::plugins::base { - munin::plugin { + + munin::plugin { [ df, cpu, interrupts, load, memory, netstat, open_files, - processes, swap, users, vmstat - ]: - ensure => present, - } - munin::plugin { - [ memory_pools, memory_types ]: + processes, swap, users, vmstat, memory_pools, memory_types ]: ensure => present, - } - + } + } diff --git a/manifests/plugins/physical.pp b/manifests/plugins/physical.pp index 6706711..1bf1465 100644 --- a/manifests/plugins/physical.pp +++ b/manifests/plugins/physical.pp @@ -1,5 +1,7 @@ class munin::plugins::physical inherits munin::plugins::base { - case $kernel { - linux: { munin::plugin { iostat: } } - } + + case $kernel { + linux: { munin::plugin { iostat: } } + } + } diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp index 6affc86..847f0b9 100644 --- a/manifests/plugins/selinux.pp +++ b/manifests/plugins/selinux.pp @@ -1,4 +1,6 @@ class munin::plugins::selinux inherits munin::plugins::base { - munin::plugin::deploy { "selinuxenforced": } - munin::plugin::deploy { "selinux_avcstats": } + + munin::plugin::deploy { "selinuxenforced": } + munin::plugin::deploy { "selinux_avcstats": } + } diff --git a/manifests/plugins/vserver.pp b/manifests/plugins/vserver.pp index bce28a1..ffc4b0a 100644 --- a/manifests/plugins/vserver.pp +++ b/manifests/plugins/vserver.pp @@ -1,7 +1,9 @@ class munin::plugins::vserver inherits munin::plugins::base { - munin::plugin { - [ netstat, processes ]: - ensure => present; - } + + munin::plugin { + [ netstat, processes ]: + ensure => present; + } + } -- cgit v1.2.3