[Nagiosplug-help] patch for check_ifoperstatus

Voon, Ton Ton.Voon at egg.com
Mon Jun 9 04:40:05 CEST 2003


Hugo,

Thanks,tThese are useful patches. Can you please add them to sourceforge so
we can track it:
http://sourceforge.net/tracker/?group_id=29880&atid=397599

Ton

-----Original Message-----
From: Hugo Lombard [mailto:hal at infosat.net]
Sent: 09 June 2003 12:02
To: nagiosplug-help at lists.sourceforge.net
Subject: [Nagiosplug-help] patch for check_ifoperstatus



This patch adds the -a/--adminwarn option, allowing one to ignore or
mark as critical interfaces that are administratively down.


--- check_ifoperstatus	Mon Jun  9 11:44:16 2003
+++ /tmp/check_ifoperstatus	Mon Jun  9 12:57:02 2003
@@ -79,6 +79,7 @@
 my $lastc;
 my $dormantWarn;
 my $name;
+my $admindownWarn;
 
 
 
@@ -104,7 +105,8 @@
 			"H=s" => \$hostname, "hostname=s" => \$hostname,
 			"I"	  => \$ifXTable, "ifmib" => \$ifXTable,
 			"n=s" => \$ifName, "name=s" => \$ifName,
-			"w=s" => \$dormantWarn, "warn=s" => \$dormantWarn );
+			"w=s" => \$dormantWarn, "warn=s" => \$dormantWarn,
+			"a=s" => \$admindownWarn, "adminwarn=s" =>
\$admindownWarn );
 
 
 				
@@ -235,8 +237,18 @@
    ## 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.";
+      if (defined $admindownWarn ) {
+         if ($admindownWarn eq "c") {
+            $state = 'CRITICAL';
+            $answer = "Interface $name (index $snmpkey) is administratively
down.";
+         }elsif($admindownWarn eq"i") {
+            $state = 'OK';
+            $answer = "Interface $name (index $snmpkey) is administratively
down.";
+         }
+      }else{
+         $state = 'WARNING';
+         $answer = "Interface $name (index $snmpkey) is administratively
down.";
+      }
 
    } 
    ## Check operational status
@@ -343,6 +355,7 @@
 	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 (--adminwarn =i|w|c) ignore|warn|crit if the interface
is administratively down (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";




This private and confidential e-mail has been sent to you by Egg.
The Egg group of companies includes Egg Banking plc
(registered no. 2999842), Egg Financial Products Ltd (registered
no. 3319027) and Egg Investments Ltd (registered no. 3403963) which
carries out investment business on behalf of Egg and is regulated
by the Financial Services Authority.  
Registered in England and Wales. Registered offices: 1 Waterhouse Square,
138-142 Holborn, London EC1N 2NA.
If you are not the intended recipient of this e-mail and have
received it in error, please notify the sender by replying with
'received in error' as the subject and then delete it from your
mailbox.





More information about the Help mailing list