[Nagiosplug-devel] [ nagiosplug-Bugs-1202797 ] Uninitialized value warning in check_ifoperstatus

SourceForge.net noreply at sourceforge.net
Sun May 22 17:19:32 CEST 2005


Bugs item #1202797, was opened at 2005-05-16 12:03
Message generated for change (Comment added) made by stanleyhopcroft
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1202797&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Embedded Perl failure
Group: CVS
Status: Open
Resolution: None
Priority: 5
Submitted By: Reuben Farrelly (reuben)
Assigned to: Subhendu Ghosh (sghosh)
Summary: Uninitialized value warning in check_ifoperstatus

Initial Comment:
I've been seeing this error for the last few weeks with
this plugin.  This is the message returned by the
plugin when invoked via Nagios:

**ePN /usr/lib/nagios/plugins/check_ifoperstatus: "Use
of uninitialized value in numeric gt (>) at (eval 3257)
line 359". 

Nagios displays an 'orange' status for this check.

line 359 looks like this:

unless ($snmpkey > 0 || defined $ifdescr){


When the command is executed manually, it looks like this:

[root at tornado plugins]#
/usr/lib/nagios/plugins/check_ifoperstatus -H
192.168.0.1 -C snmpaccess -d ATM0
OK: Interface ATM0 (index 1) is up.[root at tornado plugins]# 

(I wonder if a missing CR at the end is a bad thing..)



----------------------------------------------------------------------

>Comment By: Stanley Hopcroft (stanleyhopcroft)
Date: 2005-05-23 00:16

Message:
Logged In: YES 
user_id=395628

Dear Folks,

The problem is that the plugin does _not_ work with embedded
Perl Nagios (ePN).

ePN requires that plugins be written with more care than
those designed to be run by a shell (why ? some features
such as <DATA> handles do not work; and, in general,
variables and their values persist from the last run, so
their is more opportunity for things to go wrong. Also, ePN
runs all code under the 'strict' pragma, regardless of
whether there is a 'use strict' in the plugin. This leads to
some plugins failing to run under ePN).

As far as ePN changes go, there have been quite a lot of
changes in the 2.x code base, none related to how the plugin
is compiled or run (the changes have been attempts to deal
with memory leaks related to the threading changes in Nag
2.x and threaded Perls)

None of my 55 Perl plugins have malfunctioned (except one
that uses the Expect module. This is also a problem with
ePN. Plugins that tie or re-open stdout are not going to
play well with ePN because it ties stdout to a scalar so
that the plugin output can be captured) during this time.

My conclusion is

1 this is not an ePN problem - so this is the appropriate
support venue

2 the problem is with the plugin text not cooperating with
the use strict compilation environment in ePN. The plugin
should be patched so that it runs under ePN.

FWIW, the best way to do this is run it under the ePN
simulator (contrib/mini_epn.c if this has been updated to
correspond to the CVS .. Call me otherwise) with the
/contrib copy of p1.pl edited to
log to suitable file (DEBUG_LOG_PATH) and the DEBUG_LEVEL
set to PLUGIN_DUMP.

This should nail where the problem is.

I have up to date versions of the plugin validation tools if
anyone wants them (tools to check if plugins play nicely
with ePN).




2 



----------------------------------------------------------------------

Comment By: Subhendu Ghosh (sghosh)
Date: 2005-05-22 14:47

Message:
Logged In: YES 
user_id=46572

No - leave this open.  Need to check what ePN changes have
happened to cause this.

----------------------------------------------------------------------

Comment By: Reuben Farrelly (reuben)
Date: 2005-05-22 11:43

Message:
Logged In: YES 
user_id=26209

Disabled --enable-embedded-perl with Nagios and the error
has gone and all looks OK.  Shall I close this and re-open a
bug with Nagios instead or is this possibly just a bad
interaction between the plugin and embedded perl?


----------------------------------------------------------------------

Comment By: Reuben Farrelly (reuben)
Date: 2005-05-16 23:25

Message:
Logged In: YES 
user_id=26209

Using both -CVS of Nagios and -CVS of nagiosplug...

The config on this has not changed for many months..  Is it
worth me disabling the ePN to test?


----------------------------------------------------------------------

Comment By: Subhendu Ghosh (sghosh)
Date: 2005-05-16 22:21

Message:
Logged In: YES 
user_id=46572

This is strange. snmpkey is initialized to 0 and you are
using -d so snmpkey should remain at 0.

Which version of nagios and plugin?

How long has Nagios with ePN been running?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1202797&group_id=29880




More information about the Devel mailing list