Page 1 of 1

results showing differently

Posted: Tue Sep 29, 2020 5:36 am
by Pratapa
Hi,

When we run a script on the remote machine (which is a Linux machine) we are getting expected output whereas when we invoke it from the nagios server it is giving different output.


[host1]#/usr/lib64/nagios/plugins/ce/cleanup_transaction_manager.sh
Cleanup is normal


[nagios root]#pwd
/opt/nagios/libexec
[nagios root]#./check_nrpe -H <host1> -c check_transaction_manager_cleanup
Clean up file has errors.


What could be the reason?

Re: results showing differently

Posted: Tue Sep 29, 2020 9:08 am
by gormank
Checks automatically run by Nagios run as Nagios. Chances are you aren't running the check as nagios.

Re: results showing differently

Posted: Thu Oct 01, 2020 1:08 am
by Pratapa
I am running as nagios user only.

nrpe_user=nagios

Re: results showing differently

Posted: Thu Oct 01, 2020 1:09 am
by Pratapa
I tried as follows I am getting correct results.

sudo su - nagios -c /usr/lib64/nagios/plugins/ce/cleanup_transaction_manager.sh

Re: results showing differently

Posted: Thu Oct 01, 2020 1:26 pm
by gormank
Have you verifies the command on the remote host?
Can you run the command from the nagios host with nrpe, and on the remote hHAoSH0x7sab0ect as nagios and paste the command including the prompt and output?