return codes and output from check scripts

Brian Wilson wilson at unity.ncsu.edu
Fri Dec 6 16:04:56 CET 2002


Of course that's not the whole script, the script runs from the command
line as nagios user just fine.

On Fri, 6 Dec 2002, Stanley Hopcroft wrote:

> 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.
>
>


--
Brian Wilson  <wilson at ncsu.edu>      Network Analyst
Communication Technologies, ATD      W: 919.513.3472
North Carolina State University      www.ncstate.net


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




More information about the Users mailing list