From e2dfae5852ecdf3695a6af8ec48092ea24698390 Mon Sep 17 00:00:00 2001 From: "Christian G. Warden" Date: Thu, 2 Feb 2012 18:10:14 -0800 Subject: Fully qualify facter variables --- manifests/plugins/interfaces.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugins/interfaces.pp') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index 18a713b..b2c448b 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -5,7 +5,7 @@ class munin::plugins::interfaces { munin::plugin { $ifs: ensure => "if_"; } - case $operatingsystem { + case $::operatingsystem { openbsd: { $if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") munin::plugin{ -- cgit v1.2.3 From 9fd1de5acd9064a0d67ca9d2c13a829a3f628f39 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 5 Jun 2012 19:39:49 -0300 Subject: new style for 2.7 --- manifests/plugins/interfaces.pp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'manifests/plugins/interfaces.pp') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index b2c448b..cc79259 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,19 +1,19 @@ # handle if_ and if_err_ plugins class munin::plugins::interfaces { - $ifs = regsubst(split($interfaces, " |,"), "(.+)", "if_\\1") + $ifs = regsubst(split($::interfaces, " |,"), "(.+)", "if_\\1") munin::plugin { $ifs: ensure => "if_"; } case $::operatingsystem { openbsd: { - $if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_errcoll_\\1") + $if_errs = regsubst(split($::interfaces, " |,"), "(.+)", "if_errcoll_\\1") munin::plugin{ $if_errs: ensure => "if_errcoll_"; } } default: { - $if_errs = regsubst(split($interfaces, " |,"), "(.+)", "if_err_\\1") + $if_errs = regsubst(split($::interfaces, " |,"), "(.+)", "if_err_\\1") munin::plugin{ $if_errs: ensure => "if_err_"; } -- cgit v1.2.3 From adbfc508abf5bda607795f7bf02f9581e78b17a5 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 27 Nov 2012 21:54:19 +0100 Subject: filter out many of the useless interfaces that show up --- manifests/plugins/interfaces.pp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'manifests/plugins/interfaces.pp') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index cc79259..33fef33 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -1,21 +1,23 @@ # handle if_ and if_err_ plugins -class munin::plugins::interfaces { +class munin::plugins::interfaces { + + # filter out many of the useless interfaces that show up + $ifs = regsubst(reject(split($::interfaces, ' |,'), 'eth\d+:\d+|sit0|virbr\d+_nic|vif\d+_\d+|veth\d+'), '(.+)', 'if_\\1') - $ifs = regsubst(split($::interfaces, " |,"), "(.+)", "if_\\1") munin::plugin { - $ifs: ensure => "if_"; + $ifs: ensure => 'if_'; } case $::operatingsystem { openbsd: { - $if_errs = regsubst(split($::interfaces, " |,"), "(.+)", "if_errcoll_\\1") + $if_errs = regsubst(split($::interfaces, ' |,'), '(.+)', 'if_errcoll_\\1') munin::plugin{ - $if_errs: ensure => "if_errcoll_"; + $if_errs: ensure => 'if_errcoll_'; } } default: { - $if_errs = regsubst(split($::interfaces, " |,"), "(.+)", "if_err_\\1") + $if_errs = regsubst(split($::interfaces, ' |,'), '(.+)', 'if_err_\\1') munin::plugin{ - $if_errs: ensure => "if_err_"; + $if_errs: ensure => 'if_err_'; } } } -- cgit v1.2.3 From bc23eb26287c343358a6bfbb9a776a67db39d02e Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 27 Nov 2012 22:08:14 +0100 Subject: improve regexp --- manifests/plugins/interfaces.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'manifests/plugins/interfaces.pp') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index 33fef33..7e9819c 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -2,20 +2,21 @@ class munin::plugins::interfaces { # filter out many of the useless interfaces that show up - $ifs = regsubst(reject(split($::interfaces, ' |,'), 'eth\d+:\d+|sit0|virbr\d+_nic|vif\d+_\d+|veth\d+'), '(.+)', 'if_\\1') + $real_ifs = reject(split($::interfaces, ' |,'), 'eth\d+:\d+|sit0|virbr\d+_nic|vif\d+_\d+|veth\d+') + $ifs = regsubst($real_ifs, '(.+)', "if_\\1") munin::plugin { $ifs: ensure => 'if_'; } case $::operatingsystem { openbsd: { - $if_errs = regsubst(split($::interfaces, ' |,'), '(.+)', 'if_errcoll_\\1') + $if_errs = regsubst($real_ifs, '(.+)', "if_errcoll_\\1") munin::plugin{ $if_errs: ensure => 'if_errcoll_'; } } default: { - $if_errs = regsubst(split($::interfaces, ' |,'), '(.+)', 'if_err_\\1') + $if_errs = regsubst($real_ifs, '(.+)', "if_err_\\1") munin::plugin{ $if_errs: ensure => 'if_err_'; } -- cgit v1.2.3 From 005c89cfbd924e204e87a11248b0efe42d5cc8d6 Mon Sep 17 00:00:00 2001 From: mh Date: Tue, 27 Nov 2012 23:36:25 +0100 Subject: exclude more weird interfaces --- manifests/plugins/interfaces.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugins/interfaces.pp') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index 7e9819c..a7e8ce6 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -2,7 +2,7 @@ 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+') + $real_ifs = reject(split($::interfaces, ' |,'), 'eth\d+:\d+|sit0|virbr\d+_nic|vif\d+_\d+|veth\d+|__temp\d+') $ifs = regsubst($real_ifs, '(.+)', "if_\\1") munin::plugin { -- cgit v1.2.3 From 6a440c04ee381ff184a7b7c9f3a98ca61337df92 Mon Sep 17 00:00:00 2001 From: mh Date: Thu, 29 Nov 2012 00:24:20 +0100 Subject: filter correct unwanted interfaces --- manifests/plugins/interfaces.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'manifests/plugins/interfaces.pp') diff --git a/manifests/plugins/interfaces.pp b/manifests/plugins/interfaces.pp index a7e8ce6..da89ed0 100644 --- a/manifests/plugins/interfaces.pp +++ b/manifests/plugins/interfaces.pp @@ -2,7 +2,7 @@ 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+|__temp\d+') + $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") munin::plugin { -- cgit v1.2.3