From 03c50709169ee38cd5d759c461389b2a476fcc64 Mon Sep 17 00:00:00 2001 From: mh Date: Sun, 3 Nov 2013 17:52:36 +0100 Subject: use rather the stdlib prefix function than the good old regsubst hack --- manifests/plugins/interfaces.pp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'manifests/plugins') 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_', -- cgit v1.2.3