summaryrefslogtreecommitdiffstats
path: root/web/attachments/43217-check_ifstatus-snmplocifdescr.patch
blob: 7fdd656962e0fccf2b2eb5e57041d0c97390a179 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- 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<BR>",
+                       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<BR>",
+      $answer = sprintf("host '%s', interfaces up: %d, down: %d, dormant: %d, ",
                         $hostname,
                        $ifup,
                        $ifdown,