*** 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";