--- check_ifstatus.orig Sat Feb 22 18:18:00 2003
+++ check_ifstatus Sun Feb 23 11:23:53 2003
@@ -160,6 +160,9 @@
push(@snmpoids,$snmpIfType);
push(@snmpoids,$snmpIfName) if ( defined $ifXTable);
+if (defined($response = $session->get_table($snmpLocIfDescr))) {
+push(@snmpoids,$snmpLocIfDescr);
+}
foreach $snmpoid (@snmpoids) {
@@ -191,10 +194,17 @@
if ($ifStatus{$key}{$snmpIfOperStatus} == 1 ) { $ifup++ ;}
if ($ifStatus{$key}{$snmpIfOperStatus} == 2 ) {
$ifdown++ ;
- $ifmessage .= sprintf("%s: down -> %s
",
+ if (defined($ifStatus{$key}{$snmpLocIfDescr})) {
+ $ifmessage .= sprintf("%s: down -> %s, ",
+ $ifStatus{$key}{$snmpIfDescr},
+ $ifStatus{$key}{$snmpLocIfDescr});
+ }
+ if (!defined($ifStatus{$key}{$snmpLocIfDescr})) {
+ $ifmessage .= sprintf("%s: down -> %s, ",
$ifStatus{$key}{$snmpIfDescr},
- $ifStatus{$key}{$snmpIfName});
+ $ifStatus{$key}{$snmpIfDescr});
}
+ }
if ($ifStatus{$key}{$snmpIfOperStatus} == 5 ) { $ifdormant++ ;}
}
}
@@ -203,7 +213,7 @@
if ($ifdown > 0) {
$state = 'CRITICAL';
- $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d
",
+ $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d, ",
$hostname,
$ifup,
$ifdown,