From 0b6423f9c99d9edf8c96fefd0f6c453859395aa1 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Mon, 30 Sep 2013 00:03:24 +0200 Subject: Import Nagios Plugins site Import the Nagios Plugins web site, Cronjobs, infrastructure scripts, and configuration files. --- .../98403-check_ifoperstatus-admin.diff | 85 ++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 web/attachments/98403-check_ifoperstatus-admin.diff (limited to 'web/attachments/98403-check_ifoperstatus-admin.diff') diff --git a/web/attachments/98403-check_ifoperstatus-admin.diff b/web/attachments/98403-check_ifoperstatus-admin.diff new file mode 100644 index 0000000..8127684 --- /dev/null +++ b/web/attachments/98403-check_ifoperstatus-admin.diff @@ -0,0 +1,85 @@ +*** nagios-plugins-1.3.1/plugins-scripts/check_ifoperstatus.pl Wed Feb 12 05:32:20 2003 +--- check_ifoperstatus.pl Thu Aug 19 15:34:22 2004 +*************** +*** 78,83 **** +--- 78,84 ---- + my $key; + my $lastc; + my $dormantWarn; ++ my $adminWarn; + my $name; + + +*************** +*** 104,110 **** + "H=s" => \$hostname, "hostname=s" => \$hostname, + "I" => \$ifXTable, "ifmib" => \$ifXTable, + "n=s" => \$ifName, "name=s" => \$ifName, +! "w=s" => \$dormantWarn, "warn=s" => \$dormantWarn ); + + + +--- 105,112 ---- + "H=s" => \$hostname, "hostname=s" => \$hostname, + "I" => \$ifXTable, "ifmib" => \$ifXTable, + "n=s" => \$ifName, "name=s" => \$ifName, +! "w=s" => \$dormantWarn, "warn=s" => \$dormantWarn, +! "a=s" => \$adminWarn, "admin-down=s" => \$adminWarn ); + + + +*************** +*** 235,243 **** + ## if AdminStatus is down - some one made a consious effort to change config + ## + if ( not ($response->{$snmpIfAdminStatus} == 1) ) { +! $state = 'WARNING'; +! $answer = "Interface $name (index $snmpkey) is administratively down."; +! + } + ## Check operational status + elsif ( $response->{$snmpIfOperStatus} == 2 ) { +--- 237,252 ---- + ## if AdminStatus is down - some one made a consious effort to change config + ## + if ( not ($response->{$snmpIfAdminStatus} == 1) ) { +! $answer = "Interface $name (index $snmpkey) is administratively down."; +! if ( not defined $adminWarn or $adminWarn eq "w" ) { +! $state = 'WARNING'; +! } elsif ( $adminWarn eq "i" ) { +! $state = 'OK'; +! } elsif ( $adminWarn eq "c" ) { +! $state = 'CRITICAL'; +! } else { # If wrong value for -a, say warning +! $state = 'WARNING'; +! } + } + ## Check operational status + elsif ( $response->{$snmpIfOperStatus} == 2 ) { +*************** +*** 246,252 **** + } elsif ( $response->{$snmpIfOperStatus} == 5 ) { + if (defined $dormantWarn ) { + if ($dormantWarn eq "w") { +! $state = 'WARNNG'; + $answer = "Interface $name (index $snmpkey) is dormant."; + }elsif($dormantWarn eq "c") { + $state = 'CRITICAL'; +--- 255,261 ---- + } elsif ( $response->{$snmpIfOperStatus} == 5 ) { + if (defined $dormantWarn ) { + if ($dormantWarn eq "w") { +! $state = 'WARNING'; + $answer = "Interface $name (index $snmpkey) is dormant."; + }elsif($dormantWarn eq "c") { + $state = 'CRITICAL'; +*************** +*** 343,348 **** +--- 352,358 ---- + printf " -n (--name) the value should match the returned ifName\n"; + printf " (Implies the use of -I)\n"; + printf " -w (--warn =i|w|c) ignore|warn|crit if the interface is dormant (default critical)\n"; ++ printf " -a (--admin-down =i|w|c) same for administratively down interfaces (default warning)\n"; + printf " -V (--version) Plugin version\n"; + printf " -h (--help) usage help \n\n"; + printf " -k or -d must be specified\n\n"; -- cgit v1.2.3-74-g34f1