diff options
author | varac <varacanero@zeromail.org> | 2016-03-16 22:03:36 +0100 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-03-16 22:03:36 +0100 |
commit | 6c633f8606e04aad29f40a3fc0fcfdcb4b293715 (patch) | |
tree | 63d7c8a54a643cc628b9b4f7a3b941d9f508c4ad /manifests/plugins/interfaces.pp | |
parent | 503e9296860e4d844a1ee391331996db87e0bfa6 (diff) | |
parent | 87dc315597e8ed27c2e0907615ede8a3f1521b7a (diff) |
Diffstat (limited to 'manifests/plugins/interfaces.pp')
-rw-r--r-- | manifests/plugins/interfaces.pp | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index da89ed0..2bbc1c6 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+|__tmp\d+') - $ifs = regsubst($real_ifs, '(.+)', "if_\\1") + $real_ifs = reject(split($::interfaces, ' |,'), $munin::if_filter) + $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, } } |