Hello,
maybe someone can help with this. I have a python script from a client that is run by a bash script (which creates the necessary env variables for the python script to work).
When run from the host itself, with user nagios, the output is displayed correctly:
nagios@host:~> /var/lib/monitor_ub/custom_plugins/hx_metrics_wrapper.sh iops read 10000 60000
Ok: iops_read ha respost en 0.17 | iops_read=12618.3;10000.0;60000.0
nagios@host:~>
But when called from the poller, unable to read output:
-bash-4.2$ /usr/lib64/nagios/plugins/check_nrpe -H xxx.xxx.xxx.xxx -t 30 -c check_latency -a "iops read 10000 60000"
NRPE: Unable to read output
-bash-4.2
NRPE show this for the command ran from the poller:
nrpen28532]: Command completed with return code 1 and output:
nrpen28532]: Return Code: 3, Output: NRPE: Unable to read output
nrpen28532]: Connection from xxx.xxx.xxx.xxx closed.
As a workaround for now I have set a cron job for each option available for the python script that saves the output to a file and defined commands that read those files and generates the corresponding exit code. NRPE passes that output and the exit code correctly to the poller.
I have checked permissions and paths but can’t see what is wrong. Could it be a problem with encoding in the python script?
Regards,
Enrique