diff options
author | Gabriel Filion <gabster@lelutin.ca> | 2014-12-13 09:34:56 -0500 |
---|---|---|
committer | Gabriel Filion <gabster@lelutin.ca> | 2014-12-13 10:21:25 -0500 |
commit | 48272434978f95c70e34aebe9ce188157f8f935e (patch) | |
tree | 8c940d891cbcba026d56cf8ed2935361debc44fd /manifests/plugins/interfaces.pp | |
parent | 7e03247a9e219fe8e57d544957eb06e305e69fc1 (diff) | |
parent | 27c9a5dbc2083dcc20d059008702dd3f75382bcc (diff) |
Merge remote-tracking branch 'immerda/master' into merge_immerda
Conflicts:
manifests/plugins/interfaces.pp
$real_ifs was changed on master and we'd like to keep that change
$ifs was changed to use the prefix() function and we'd like to keep that
change.
Diffstat (limited to 'manifests/plugins/interfaces.pp')
-rw-r--r-- | manifests/plugins/interfaces.pp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index c57e887..35b41fd 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,25 +1,21 @@ # 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+|vnet\d+|__tmp\d+') - $ifs = regsubst($real_ifs, '(.+)', "if_\\1") + $ifs = prefix($real_ifs, 'if_') - munin::plugin { - $ifs: ensure => 'if_'; + $if_err_plugin = $::operatingsystem ? { + 'openbsd' => 'if_errcoll_', + default => 'if_err_', } - case $::operatingsystem { - openbsd: { - $if_errs = regsubst($real_ifs, '(.+)', "if_errcoll_\\1") - munin::plugin{ - $if_errs: ensure => 'if_errcoll_'; - } - } - default: { - $if_errs = regsubst($real_ifs, '(.+)', "if_err_\\1") - munin::plugin{ - $if_errs: ensure => 'if_err_'; - } - } + $if_errs = prefix($real_ifs, $if_err_plugin) + + munin::plugin { $ifs: + ensure => 'if_', + } + + munin::plugin { $if_errs: + ensure => $if_err_plugin, } } |