summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'manifests')
-rw-r--r--manifests/client/openbsd.pp46
-rw-r--r--manifests/plugins/dom0.pp2
-rw-r--r--manifests/plugins/interfaces.pp17
-rw-r--r--manifests/plugins/selinux.pp2
4 files changed, 36 insertions, 31 deletions
diff --git a/manifests/client/openbsd.pp b/manifests/client/openbsd.pp
index 88d0640..1852962 100644
--- a/manifests/client/openbsd.pp
+++ b/manifests/client/openbsd.pp
@@ -3,14 +3,16 @@
class munin::client::openbsd inherits munin::client::base {
if $::operatingsystemrelease == '4.3' {
file{'/usr/src/munin_openbsd.tar.gz':
- source => "puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz",
- owner => root, group => 0, mode => 0600;
+ source => "puppet:///modules/munin/openbsd/package/munin_openbsd.tar.gz",
+ owner => root,
+ group => 0,
+ mode => '0600';
}
exec{'extract_openbsd':
command => 'cd /;tar xzf /usr/src/munin_openbsd.tar.gz',
- unless => 'test -d /opt/munin',
+ unless => 'test -d /opt/munin',
require => File['/usr/src/munin_openbsd.tar.gz'],
- before => File['/var/run/munin'],
+ before => File['/var/run/munin'],
}
package{'p5-Compress-Zlib':
ensure => installed,
@@ -28,32 +30,32 @@ class munin::client::openbsd inherits munin::client::base {
before => File['/var/run/munin'],
}
file{[ '/var/run/munin', '/var/log/munin' ]:
- ensure => directory,
- owner => root, group => 0, mode => 0755;
+ ensure => directory,
+ owner => root,
+ group => 0,
+ mode => '0755';
+ }
+ $bin_loc = $::operatingsystemrelease ? {
+ '4.3' => '/opt/munin/sbin/munin-node',
+ default => '/usr/local/sbin/munin-node'
}
openbsd::rc_local{'munin-node':
- binary => $::operatingsystemrelease ? {
- '4.3' => '/opt/munin/sbin/munin-node',
- default => '/usr/local/sbin/munin-node'
- },
+ binary => $bin_loc,
require => File['/var/run/munin'],
}
Service['munin-node']{
- restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`',
- stop => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`',
- start => $::operatingsystemrelease ? {
- '4.3' => '/opt/munin/sbin/munin-node',
- default => '/usr/local/sbin/munin-node'
- },
- status => 'test -e /var/run/munin/munin-node.pid && (ps ax | egrep -q "^$(cat /var/run/munin/munin-node.pid).*munin-node")',
- hasstatus => true,
- hasrestart => true,
- require => [ File['/var/run/munin'], File['/var/log/munin'] ],
+ restart => '/bin/kill -HUP `/bin/cat /var/run/munin/munin-node.pid`',
+ stop => '/bin/kill `/bin/cat /var/run/munin/munin-node.pid`',
+ start => $bin_loc,
+ status => 'test -e /var/run/munin/munin-node.pid && (ps ax | egrep -q "^ *$(cat /var/run/munin/munin-node.pid).*munin-node")',
+ hasstatus => true,
+ hasrestart => true,
+ require => [ File['/var/run/munin'], File['/var/log/munin'] ],
}
cron{'clean_munin_logfile':
command => 'rm /var/log/munin/munin-node.log; kill -HUP `cat /var/run/munin/munin-node.pid`',
- minute => 0,
- hour => 2,
+ minute => 0,
+ hour => 2,
weekday => 0,
}
}
diff --git a/manifests/plugins/dom0.pp b/manifests/plugins/dom0.pp
index ed4f62c..44995fc 100644
--- a/manifests/plugins/dom0.pp
+++ b/manifests/plugins/dom0.pp
@@ -1,6 +1,6 @@
class munin::plugins::dom0 {
munin::plugin::deploy {
- [ 'xen', 'xen-cpu', 'xen_memory', 'xen_mem',
+ [ 'xen', 'xen_cpu', 'xen_memory', 'xen_mem',
'xen_vm', 'xen_vbd', 'xen_traffic_all' ]:
config => 'user root';
}
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp
index cc79259..da89ed0 100644
--- a/manifests/plugins/interfaces.pp
+++ b/manifests/plugins/interfaces.pp
@@ -1,21 +1,24 @@
# 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+|__tmp\d+')
+ $ifs = regsubst($real_ifs, '(.+)', "if_\\1")
- $ifs = regsubst(split($::interfaces, " |,"), "(.+)", "if_\\1")
munin::plugin {
- $ifs: ensure => "if_";
+ $ifs: ensure => 'if_';
}
case $::operatingsystem {
openbsd: {
- $if_errs = regsubst(split($::interfaces, " |,"), "(.+)", "if_errcoll_\\1")
+ $if_errs = regsubst($real_ifs, '(.+)', "if_errcoll_\\1")
munin::plugin{
- $if_errs: ensure => "if_errcoll_";
+ $if_errs: ensure => 'if_errcoll_';
}
}
default: {
- $if_errs = regsubst(split($::interfaces, " |,"), "(.+)", "if_err_\\1")
+ $if_errs = regsubst($real_ifs, '(.+)', "if_err_\\1")
munin::plugin{
- $if_errs: ensure => "if_err_";
+ $if_errs: ensure => 'if_err_';
}
}
}
diff --git a/manifests/plugins/selinux.pp b/manifests/plugins/selinux.pp
index faf610a..d094f35 100644
--- a/manifests/plugins/selinux.pp
+++ b/manifests/plugins/selinux.pp
@@ -1,3 +1,3 @@
class munin::plugins::selinux {
- munin::plugin::deploy { [ 'selinuxenforced', 'selinux_avcstats' ]: }
+ munin::plugin{ [ 'selinux_avcstat' ]: }
}