summaryrefslogtreecommitdiffstats
path: root/plugins-scripts
diff options
context:
space:
mode:
authorSubhendu Ghosh <sghosh@users.sourceforge.net>2002-08-14 19:06:38 (GMT)
committerSubhendu Ghosh <sghosh@users.sourceforge.net>2002-08-14 19:06:38 (GMT)
commitbb59a4ce8769f9b8533674dce341af71a4864dc0 (patch)
tree749050006bc11dcb4f60bcf322c364133eb12d21 /plugins-scripts
parent325e642ae83045f15a3b19e9f8754a46a0d68ac0 (diff)
downloadmonitoring-plugins-bb59a4ce8769f9b8533674dce341af71a4864dc0.tar.gz
skip PPP interfaces
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@78 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins-scripts')
-rwxr-xr-xplugins-scripts/check_ifstatus.pl23
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins-scripts/check_ifstatus.pl b/plugins-scripts/check_ifstatus.pl
index f54008f..3b8a19c 100755
--- a/plugins-scripts/check_ifstatus.pl
+++ b/plugins-scripts/check_ifstatus.pl
@@ -61,6 +61,7 @@ my $snmpIfOperStatus = '1.3.6.1.2.1.2.2.1.8';
61my $snmpIfName = '1.3.6.1.2.1.31.1.1.1.1'; 61my $snmpIfName = '1.3.6.1.2.1.31.1.1.1.1';
62my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18'; 62my $snmpIfAlias = '1.3.6.1.2.1.31.1.1.1.18';
63my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28'; 63my $snmpLocIfDescr = '1.3.6.1.4.1.9.2.2.1.1.28';
64my $snmpIfType = '1.3.6.1.2.1.2.2.1.3';
64my $hostname; 65my $hostname;
65my $session; 66my $session;
66my $error; 67my $error;
@@ -156,6 +157,7 @@ if ( ! $snmp_version ) {
156push(@snmpoids,$snmpIfOperStatus); 157push(@snmpoids,$snmpIfOperStatus);
157push(@snmpoids,$snmpIfAdminStatus); 158push(@snmpoids,$snmpIfAdminStatus);
158push(@snmpoids,$snmpIfDescr); 159push(@snmpoids,$snmpIfDescr);
160push(@snmpoids,$snmpIfType);
159push(@snmpoids,$snmpIfName) if ( defined $ifXTable); 161push(@snmpoids,$snmpIfName) if ( defined $ifXTable);
160 162
161 163
@@ -184,17 +186,18 @@ foreach $key (keys %ifStatus) {
184 186
185 # check only if interface is administratively up 187 # check only if interface is administratively up
186 if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) { 188 if ($ifStatus{$key}{$snmpIfAdminStatus} == 1 ) {
187 if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ;} 189 # check only if interface is not of type 23 aka PPP interface
188 if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) { 190 if ($ifStatus{$key}{$snmpIfType} != 23 ) {
189 $ifdown++ ; 191 if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ;}
190 $ifmessage .= sprintf("%s: down -> %s<BR>", 192 if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) {
193 $ifdown++ ;
194 $ifmessage .= sprintf("%s: down -> %s<BR>",
191 $ifStatus{$key}{$snmpIfDescr}, 195 $ifStatus{$key}{$snmpIfDescr},
192 $ifStatus{$key}{$snmpIfName}); 196 $ifStatus{$key}{$snmpIfName});
193 197 }
194 } 198 if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;}
195 if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;} 199 }
196 } 200 }
197 }
198 201
199 202
200 if ($ifdown > 0) { 203 if ($ifdown > 0) {
@@ -232,7 +235,7 @@ sub usage {
232 235
233sub print_help { 236sub print_help {
234 printf "check_ifstatus plugin for Nagios monitors operational \n"; 237 printf "check_ifstatus plugin for Nagios monitors operational \n";
235 printf "status of each network interface on the target host\n"; 238 printf "status of each network interface (except PPP interfaces) on the target host\n";
236 printf "\nUsage:\n"; 239 printf "\nUsage:\n";
237 printf " -H (--hostname) Hostname to query - (required)\n"; 240 printf " -H (--hostname) Hostname to query - (required)\n";
238 printf " -C (--community) SNMP read community (defaults to public,\n"; 241 printf " -C (--community) SNMP read community (defaults to public,\n";