[Nagiosplug-devel] Bug 691412 revisited

Mike McHenry mmchenry at frozenwasteland.com
Mon Mar 10 10:56:05 CET 2003


I wanted to revisit a bug I submitted a few weeks ago in the tracking system
and give a more in depth description of my experiences with this issue.
Currently the bug is closed but I think it should be looked at again.

The basic crux of this issue is this: Cisco devices support an SNMP OID
called LocIfDescr which is basically a local interface descriptor. Most
other devices do not support this OID and thus this plugin reverts back to
the IfDescr OID.

Current behavior with the check_ifstatus plugin is to manipulate this
difference by using the -I flag (as I understand things). The patch I
submitted in 691412 actually automates this process and allows the
check_ifstatus plugin to work transparently no matter what device it is run
against.

Here is the main reason I am pushing for this patch. There is still a logic
bug in the code that can generate errors under certain circumstances. See
the output below on the stock check_ifstatus plugin run against a Cisco
device and against a Cabletron device....

CISCO DEVICE
============
# ./check_ifstatus.old -C xx -H switch.example.com
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
CRITICAL: host 'switch.example.com', interfaces up: 9, down: 1, dormant:
0<BR>FastEthernet0/24: down -> <BR>

# ./check_ifstatus.old -C xx -H switch.example.com -I
CRITICAL: host 'switch.example.com', interfaces up: 9, down: 1, dormant:
0<BR>FastEthernet0/24: down -> Fa0/24<BR>


Running check_ifstatus with -I does not give the LocIfDescr field while
running check_ifstatus without it generates sprintf errors.


CABLETRON DEVICE
================
# ./check_ifstatus.old -C xx -H border.example.com   
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
Use of uninitialized value in sprintf at ./check_ifstatus.old line 194.
CRITICAL: host 'border.example.com', interfaces up: 10, down: 12, dormant:
0<BR>Physical port: t3.14.2: down -> <BR>Physical port: t3.14.3: down ->
<BR>Physical port: t3.16.4: down -> <BR>Physical port: t3.14.4: down ->
<BR>Physical port: t3.15.1: down -> <BR>Physical port: t3.15.2: down ->
<BR>Physical port: t3.15.3: down -> <BR>Physical port: t3.14.1: down ->
<BR>Physical port: t3.15.4: down -> <BR>Physical port: t3.16.1: down ->
<BR>Physical port: t3.16.2: down -> <BR>Physical port: t3.16.3: down -> <BR>

Again we get sprintf errors on a non-cisco device.


The patch I have included corrects this behavior and should remove the need
for the -I flag as I understand it. I have been running this patch on a
production network for several months no with no abnormal behavior noted.
This patch has been tested against many different models of Cisco routers
and switches and also against Cabletron/Riverstone style equipment. Comments
are welcome, thanks!

Mike McHenry
 Senior Network Engineer
 ORIGIX Corp.





More information about the Devel mailing list