[Nagiosplug-devel] Re: [Nagios-devel] check_ifstatus.pl and check_ifoperstatus.pl
Stanley Hopcroft
Stanley.Hopcroft at IPAustralia.Gov.AU
Wed Dec 25 02:09:04 CET 2002
Dear Sir,
I am writing to thank you for your letter, wish you and your family a
happy Christmas and say,
On Mon, Dec 23, 2002 at 12:44:05PM -0500, Russell Scibetti wrote:
> 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.
>
Yep.
> 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:
>
This however is a little more controversial, modulo no experience with
Net::SNMP.
1 That is not my experience with the POSIX module of an older Perl
(5.00503). The plugin compiles fine with the POSIX module (but without
Net::SNMP since I don't have it).
pc09011> perl -c check_ifstatus
check_ifstatus syntax OK
pc09011> perl -v
This is perl, version 5.005_03 built for i386-freebsd
That said, I think the POSIX module should not be imported since it is a
humungous module most often used to import only nominated POSIX
functions such as strftime, and more importantly is not AFAIK used by
either of these checks.
> 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
what this looks like to me is a problem with the use statement for
Net::SNMP, especially since line 40 is the line referring to that module
and the names 'INTEGER' etc are the standard exports for Net::SNMP.
Does your version of the plugin have
'use Net::SNMP;' or
'use Net::SNMP();' ?
>
>
> 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
Yours sincerely.
--
------------------------------------------------------------------------
Stanley Hopcroft
------------------------------------------------------------------------
'...No man is an island, entire of itself; every man is a piece of the
continent, a part of the main. If a clod be washed away by the sea,
Europe is the less, as well as if a promontory were, as well as if a
manor of thy friend's or of thine own were. Any man's death diminishes
me, because I am involved in mankind; and therefore never send to know
for whom the bell tolls; it tolls for thee...'
from Meditation 17, J Donne.
More information about the Devel
mailing list