[Nagiosplug-checkins] CVS: nagiosplug/plugins-scripts check_ifstatus.pl,1.1,1.2

Subhendu Ghosh sghosh at users.sourceforge.net
Wed Aug 14 12:07:17 CEST 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins-scripts
In directory usw-pr-cvs1:/tmp/cvs-serv2908

Modified Files:
	check_ifstatus.pl 
Log Message:
skip PPP interfaces

Index: check_ifstatus.pl
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins-scripts/check_ifstatus.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** check_ifstatus.pl	8 May 2002 04:58:22 -0000	1.1
--- check_ifstatus.pl	14 Aug 2002 19:06:38 -0000	1.2
***************
*** 62,65 ****
--- 62,66 ----
  my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18';
  my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28';
+ my $snmpIfType = '1.3.6.1.2.1.2.2.1.3';
  my $hostname;
  my $session;
***************
*** 157,160 ****
--- 158,162 ----
  push(@snmpoids,$snmpIfAdminStatus);
  push(@snmpoids,$snmpIfDescr);
+ push(@snmpoids,$snmpIfType);
  push(@snmpoids,$snmpIfName) if ( defined $ifXTable);
  
***************
*** 185,199 ****
  	# check only if interface is administratively up
      if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
!     	if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ;}
!         if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) {
!              $ifdown++ ;
!              $ifmessage .= sprintf("%s: down -> %s<BR>",
                                   $ifStatus{$key}{$snmpIfDescr},
  								 $ifStatus{$key}{$snmpIfName});
! 
!          }
!          if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;}
!       }
!    }
     
  
--- 187,202 ----
  	# check only if interface is administratively up
      if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
!     	# check only if interface is not of type 23  aka PPP interface
! 		if ($ifStatus{$key}{$snmpIfType} != 23 ) {
! 			if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ;}
!         	if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) {
!             	$ifdown++ ;
! 				$ifmessage .= sprintf("%s: down -> %s<BR>",
                                   $ifStatus{$key}{$snmpIfDescr},
  								 $ifStatus{$key}{$snmpIfName});
! 			}
!          	if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;}
! 		}
! 	}
     
  
***************
*** 233,237 ****
  sub print_help {
  	printf "check_ifstatus plugin for Nagios monitors operational \n";
!   	printf "status of each network interface on the target host\n";
  	printf "\nUsage:\n";
  	printf "   -H (--hostname)   Hostname to query - (required)\n";
--- 236,240 ----
  sub print_help {
  	printf "check_ifstatus plugin for Nagios monitors operational \n";
!   	printf "status of each network interface (except PPP interfaces) on the target host\n";
  	printf "\nUsage:\n";
  	printf "   -H (--hostname)   Hostname to query - (required)\n";





More information about the Commits mailing list