From c559d48491bf5de566ed51bece43a9ba10cc0b50 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 31 Aug 2012 13:22:57 +0200 Subject: [PATCH] check_junos: Added support for the exclude feature to all checks. --- check_junos.pl | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/check_junos.pl b/check_junos.pl index 83119d1..6375790 100755 --- a/check_junos.pl +++ b/check_junos.pl @@ -278,7 +278,13 @@ sub check_interfaces foreach my $iface (@interfaces) { my $name = $plugin->get_query_object_value($iface, 'name'); my $desc = $plugin->get_query_object_value($iface, 'description'); - my $status = check_interface($plugin, $iface, $opts, @$targets); + my $status; + + if (grep { m/^$name$/ } @$exclude) { + next; + } + + $status = check_interface($plugin, $iface, $opts, @$targets); my $tmp; @@ -383,6 +389,10 @@ sub check_interface_forwarding next; } + if (grep { m/^$name$/ } @$exclude) { + next; + } + foreach my $vlan_member ($plugin->get_query_object($iface, ['interface-vlan-member-list', 'interface-vlan-member'])) { my $status = $plugin->get_query_object_value($vlan_member, @@ -444,6 +454,10 @@ sub check_chassis_environment next; } + if (grep { m/^$name$/ } @$exclude) { + next; + } + if ($plugin->get_query_object_value($item, 'class')) { $class = $plugin->get_query_object_value($item, 'class'); } @@ -539,6 +553,10 @@ sub check_system_storage next; } + if (grep { m/^$mnt_pt$/ } @$exclude) { + next; + } + my $used = $plugin->get_query_object_value($fs, 'used-percent') + 0; my $state = $plugin->check_threshold($used);