results showing differently

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
Pratapa
Posts: 144
Joined: Tue Oct 01, 2019 1:33 am

results showing differently

Post 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?
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: results showing differently

Post by gormank »

Checks automatically run by Nagios run as Nagios. Chances are you aren't running the check as nagios.
Pratapa
Posts: 144
Joined: Tue Oct 01, 2019 1:33 am

Re: results showing differently

Post by Pratapa »

I am running as nagios user only.

nrpe_user=nagios
Pratapa
Posts: 144
Joined: Tue Oct 01, 2019 1:33 am

Re: results showing differently

Post by Pratapa »

I tried as follows I am getting correct results.

sudo su - nagios -c /usr/lib64/nagios/plugins/ce/cleanup_transaction_manager.sh
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: results showing differently

Post 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?
Locked