summaryrefslogtreecommitdiff
path: root/manifests/plugins/interfaces.pp
diff options
context:
space:
mode:
authorduritong <peter.meier+github@immerda.ch>2013-08-25 04:01:08 -0700
committerduritong <peter.meier+github@immerda.ch>2013-08-25 04:01:08 -0700
commit9a98e96366ed2986fcce2b9a6298580583ab62c7 (patch)
treeb2dd2f25149b0752486d7c28092c468a5926663e /manifests/plugins/interfaces.pp
parentf79c556357cdd4e0a06596b32661e3f156e2fc4f (diff)
parent42488b04b47ec3fd87f1d45ec3fa90b588545ca1 (diff)
Merge pull request #12 from oxilion/linting
lintify
Diffstat (limited to 'manifests/plugins/interfaces.pp')
-rw-r--r--manifests/plugins/interfaces.pp30
1 files changed, 13 insertions, 17 deletions
diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp
index da89ed0..b92802b 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 {
+
+ $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")
+ $ifs = regsubst($real_ifs, '(.+)', 'if_\1')
+ $if_errs = regsubst($real_ifs, '(.+)', "${if_err_plugin}\1")
- munin::plugin {
- $ifs: ensure => 'if_';
+ munin::plugin { $ifs:
+ ensure => 'if_',
}
- 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_';
- }
- }
+
+ munin::plugin { $if_errs:
+ ensure => $if_err_plugin,
}
}