Nagios ignores check_nrpe return code
Rene Rembarz
Rene.Rembarz at ericsson.com
Mon Sep 8 14:34:52 CEST 2008
Hi Andreas,
Thanks for your reply. The echo $? Was just something I did to show you guys that check_nrpe correctly captures the return code of the remote plugin and exits with that same return code.
The actual command definition looks like this:
define command {
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Cheers,
René
> -----Original Message-----
> From: Andreas Ericsson [mailto:ae at op5.se]
> Sent: Montag, 8. September 2008 14:24
> To: Rene Rembarz
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Nagios ignores check_nrpe return code
>
> Rene Rembarz wrote:
> > Dear all,
> >
> > I have a problem with my Nagios (v3.0.3) ignoring the
> return code of check_nrpe (v2.10). An example check_nrpe
> query looks like this:
> >
> > # /usr/lib/nagios/plugins/check_nrpe -H 10.0.1.10 -c
> check_users ; echo "Return code: $?"
> >
>
> If that's what your check_nrpe requests look like, I'm not
> surprised you're having problems.
>
> > USERS WARNING - 1 users currently logged in |users=1;1;2;0 Return
> > code: 1
> >
> > Based on the return code, Nagios should (if I am niot
> mistaken) display the service as status "WARNING". But the
> Service State Information page in Nagios reads:
> >
>
> Nagios doesn't see the return code of check_nrpe in this
> case. It sees the return code of 'echo'. AFAIK, 'echo' always
> returns 0.
>
> > Current Status: OK (green color)
> > Status Information: USERS WARNING - 1 users currently logged in
> >
> > This happens with all service I monitor via nrpe, the check
> itself goes ok, the status information is displyed correctly,
> but Nagios does not show the right status based on the return
> code. For local services on the nagios machine (e.g., a local
> check_users) this works just fine, so really seems to be
> something between nagios and check_nrpe.
> >
>
> Remove the '; echo $?' after the check_nrpe check thing and
> it will start working again.
>
> --
> Andreas Ericsson andreas.ericsson at op5.se
> OP5 AB www.op5.se
> Tel: +46 8-230225 Fax: +46 8-230231
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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