[Nagios-devel] check_ifstatus.pl and check_ifoperstatus.pl

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Guest

[Nagios-devel] check_ifstatus.pl and check_ifoperstatus.pl

Post by Guest »

I have found a definite bug in check_ifstatus.pl from Nagiosplug 1.3b2.
There is a closing curly brace missing to end the

foreach $key (keys %ifStatus) {

loop that starts at line 185. This is a definite problem that's easy to
fix.

There is also a potential other problem with this and the
check_ifoperstatus.pl plugin. Both have the line "use POSIX;" in the
plugin. However, with this line in, I get this error:

PROMPT:/usr/local/nagios/infra/libexec> ./check_ifoperstatus

Prototype mismatch: sub main::NULL vs () at
/usr/lib/perl5/5.6.0/Exporter.pm line 57.
Exporter::import('INTEGER', 'INTEGER32', 'OCTET_STRING', 'NULL',
'OBJECT_IDENTIFIER', 'IPADDRESS', 'COUNTER', 'COUNTER32', ...) called at
./check_ifoperstatus line 40
main::BEGIN() called at
/usr/lib/perl5/site_perl/5.6.0/Net/SNMP.pm line 40
require 0 called at /usr/lib/perl5/site_perl/5.6.0/Net/SNMP.pm
line 4


When I comment out that line (and fix the missing curly brace), both
plugins work fine. So, my question is, what is the use POSIX line
supposed to be doing, and is it necessary?

I have included a context diff patch that adds the curly brace and
comments out the use POSIX line in check_ifstatus.pl. Thanks.

-Russell Scibetti

--
Russell Scibetti
Quadrix Solutions, Inc.
http://www.quadrix.com
(732) 235-2335, ext. 7038







This post was automatically imported from historical nagios-devel mailing list archives
Original poster: russell@quadrix.com
Locked