Perl plugin exit code?
Jeff
jsmforum at optonline.net
Wed Sep 7 17:45:36 CEST 2005
ALL,
Thanks for the suggestions. I did manage to get it to work. I had to
use strict and declare all my variables.
Thanks,
Jeff
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf
> Of Andreas Ericsson
> Sent: Tuesday, September 06, 2005 18:03
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Perl plugin exit code?
>
>
> Jeff wrote:
> > Hey all,
> >
> > I've written a perl script to check the status of some information
> > from one of our application databases. It seems to run
> fine manually
> > but nagios only get's (No Output!) when I try to use it live.
> >
> > Permissions on the perl script are set correctly, if I su - over to
> > nagios I can run the script as nagios. So I'm stumped and
> looking for
> > ideas here.
> >
>
> Are you running Nagios with the embedded perl interpreter
> turned on? If
> so, try re-compiling without it, or make sure the mini-epn
> can execute
> the script. This can (in part) be assured by making it run without
> warnings with the strict pragma and the -wT options to the
> hashbang line.
>
> > Second part of my question has to do with perl more than nagios,
> > Obviously I need to send the correct exit code to nagios. I set a
> > varialble "$status" (0, 1 or 2) in the script according to
> the query
> > results and at the end of the script I have
> >
> > Exit $status;
> >
> > Will this give the correct exit status that nagios is looking for?
> >
>
> Yes.
>
> --
> Andreas Ericsson andreas.ericsson at op5.se
> OP5 AB www.op5.se
> Lead Developer
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference &
> EXPO September 19-22, 2005 * San Francisco, CA * Development
> Lifecycle Practices Agile & Plan-Driven Development *
> Managing Projects & Teams * Testing & QA Security * Process
> Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> ::: Please include Nagios version, plugin version (-v) and OS
> when reporting any issue.
> ::: Messages without supporting info will risk being sent to /dev/null
>
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list