check_nrpe event handler early exit

Andreas Ericsson ae at op5.se
Wed Dec 1 20:04:09 CET 2004


Robert.Lattanzi at fitchratings.com wrote:
> Hello All-
> I have an event handler that executes a Weblogic restart via nrpe on a
> remote server. Nagios connects successfully (via check_nrpe) to the remote
> nrpe daemon, the restart script starts to run,  but then exits without
> completing successfully. It appears as if only the first command in the
> restart script executes (an echo of the LD_LIBRARY_PATH) and then it exits.
> If I change the first command in my restart script to "echo foo" it prints
> foo and then exits.

NRPE only returns exactly one line of output. That's how nagios does it, 
so that's how NRPE does it. Are you absolutely positive that the script 
doesn't continue to run, but you don't get any further output? It's also 
more than likely that the script would need elevated privileges to be 
able to send signals to another process.

> The restart script works successfully, every time, from
> the command line. Any hints on this?

Are you running it as the same user as NRPE runs as?

> I've seen similar behavior when trying
> to restart Apache...if my restart script contains two lines (one doing a
> stop and another doing a start) only the stop gets executed.

You're possibly putting them too close together (in a wallclock sense of 
speaking). Add a "sleep 5" line between them. That should allow all 
processes to clear away their pid- and lock-files.

> I've played with the -t option to check_nrpe, by it seems as if all this
> does is specify how long check_nrpe will wait to connect to the remote nrpe
> daemon, not how long the connections will stay open.

That's just plain wrong. The -t switch tells check_nrpe how long to live 
in total. It doesn't hang around waiting for the buss before trying to 
connect.

> I've also tried backgrounding the restart.

That won't help in the slightest. Try having it log to a file instead. 
That way you should be able to follow execution from one end to another.

> Thanks in advance, Robert
> 

You're welcome.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Lead Developer


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
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