diff options
author | micah <micah@muck.riseup.net> | 2013-03-20 18:25:28 -0400 |
---|---|---|
committer | micah <micah@muck.riseup.net> | 2013-03-20 18:25:28 -0400 |
commit | c9748747c5c755443d80445a9a6c3f5d2ab3bc7f (patch) | |
tree | 65887003b9bceefd7a6ba3e3692b9a6f08373304 /manifests/plugins/interfaces.pp | |
parent | 149a78e7a8465da97f8ea267cd6a75e3bcdefe4d (diff) | |
parent | f79f662bedbbd75c7e2022da282ba48c1b323e90 (diff) |
Merge branch 'immerda/master'
Conflicts:
files/plugins/xen-cpu
templates/munin-node.conf.Debian.squeeze
Diffstat (limited to 'manifests/plugins/interfaces.pp')
-rw-r--r-- | manifests/plugins/interfaces.pp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index 18a713b..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 { + 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_'; } } } |