summaryrefslogtreecommitdiff
path: root/manifests/plugins/interfaces.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/plugins/interfaces.pp')
-rw-r--r--manifests/plugins/interfaces.pp19
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_';
}
}
}