summaryrefslogtreecommitdiff
path: root/manifests/plugins/interfaces.pp
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-11-03 17:52:36 +0100
committermh <mh@immerda.ch>2013-11-03 17:52:36 +0100
commit03c50709169ee38cd5d759c461389b2a476fcc64 (patch)
treec7b6a187ac0c5c408de752fb9aaf5ecb8e0be728 /manifests/plugins/interfaces.pp
parentd2a2cb77b9a9ca5deddecdec3d14ac763388929e (diff)
use rather the stdlib prefix function than the good old regsubst hack
Diffstat (limited to 'manifests/plugins/interfaces.pp')
-rw-r--r--manifests/plugins/interfaces.pp11
1 files changed, 6 insertions, 5 deletions
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_',