return codes and output from check scripts

Stanley Hopcroft Stanley.Hopcroft at IPAustralia.Gov.AU
Thu Dec 5 22:11:48 CET 2002


Dear Sir,

On Thu, Dec 05, 2002 at 02:51:35PM -0500, Brian Wilson wrote:
> 
> use utils qw(%ERRORS);
> if ($ps1status == 2 && $ps2status == 2 ) {
>         print "SNMP OK - Chassis Power Supplies OK\n";
>         exit $ERRORS{'OK'};
> } else {
>         print "SNMP CRITICAL - Chassis Power Supply Failure\n";
>         exit $ERRORS{'CRITICAL'};
> }
> 
> 
> Brian
> 

Is that all the script ?

Perhaps this is a stupid question but were are the values of $ps1status
and $ps2status being set ?

FWIW, 'No output' is almost always some fault in the script or the
script environment (the Nagios user is unlikely to have the same
permissions as your shell.

If in doubt, compile another copy of Nagios with the service check debug
configure option (see Debugging in the Docs) and run it from the
foreground (with your production config or a stripped down one) or try
the mini_epn in the contrib directory.

Last resort is standard script/CGI debugging techniques: have the script
ouput state ad nauseum.

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.


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list