How can I make check_nrpe wait for my remote script to finish executing?

Posted by Rauffle on Server Fault See other posts from Server Fault or by Rauffle
Published on 2011-11-17T23:06:25Z Indexed on 2011/11/18 1:53 UTC
Read the original article Hit count: 662

Filed under:
|
|
|
|

I have a python script that's being used as a plugin for NRPE. This script checks to see if a process if running on a virtual machine by doing an SSH one-liner with a "ps ax | grep process" attached. When executing the script manually, it works as expected and returns a single line of output for NRPE as well as a status based on whether or not the process is running.

When I attempt to run the command setup to execute this script (from my Nagios server), I instantly get the output "NRPE: Unable to read output", however when I run the script manually it takes about a second before it returns output. Other commands run just fine, so it would seem like NRPE needs to wait a second or two for output rather than instantly failing, but I've been unable to find any way of accomplishing this; any tips?

Thanks

PS: The virtual machines are not accessible from anywhere other than the host machine, hence the need for the nrpe plugin to ssh from the host into the VM to check the process.

© Server Fault or respective owner

Related posts about linux

Related posts about ubuntu