Page 1 of 1

Different Results

Posted: Fri Oct 16, 2020 5:59 am
by rahul2gupta
Hi,

We are facing one unprecedented error here.When we run the script in one of the client machine it shows the following results.

[root@aagwmapeai339 ce]# sh check_eai_sap_transaction_manager_cleanup.sh
0
EAI SAP TransactionManager Cleanup is normal

While when we run on the main server its shows different:

[root@aeaginfkon01 libexec]# ./check_nrpe -H aagwmapeai339 -c check_transaction_manager_cleanup
1
EAI SAP TransactionManager Cleanup is normal

Can you please guide us how to overcome this problem?

Regards,
rahul

Re: Different Results

Posted: Fri Oct 16, 2020 4:10 pm
by benjaminsmith
Hi rahul,

Thanks for posting to the Community Forum. I believe this might be an issue with the script itself. Was this script downloaded from the Nagios Exchange or did you write it?

Also, I would test the plugin using the nagios user account as that's how it will run.

Re: Different Results

Posted: Mon Oct 19, 2020 1:51 am
by rahul2gupta
Hi,

We wrote the script. It is not the one downloaded from Nagiosn exchange.

Following is the script.

cat /home/ansible/server.log|grep "TransactionManager: Deleting transactions:"|grep "00:00" && echo "EAI SAP TransactionManager Cleanup is normal"

When we execute the script on client machine we are getting expected results.

[root@host1 nrpe.d]# sh /usr/lib64/nagios/plugins/ce/check_eai_sap_transaction_manager_cleanup.sh
2020-10-19 00:00:00 AEDT [SAP.0110.0021I] (tid=486877) TransactionManager: Deleting transactions: 610 deleted.
EAI SAP TransactionManager Cleanup is normal

but when we invoke it from Nagios server, it is giving error.

[root@nagios libexec]# ./check_nrpe -H host1 -c check_transaction_manager_cleanup
NRPE: Unable to read output


Following is the entry in nrpe.cfg file

command[check_transaction_manager_cleanup]=/usr/lib64/nagios/plugins/ce/check_eai_sap_transaction_manager_cleanup.sh

We tried executing the script using nagios user on client machine. we are getting expected resunts.

[root@host1 nrpe.d]# su - nagios
Last login: Mon Oct 19 17:23:21 AEDT 2020 on pts/1
-bash-4.2$ sh /usr/lib64/nagios/plugins/ce/check_eai_sap_transaction_manager_cleanup.sh
2020-10-19 00:00:00 AEDT [SAP.0110.0021I] (tid=486877) TransactionManager: Deleting transactions: 610 deleted.
EAI SAP TransactionManager Cleanup is normal
-bash-4.2$


We verified log file /var/log/messages.

Oct 19 17:47:05 host1 nrpe[34977]: Warning: Unable to change supplementary groups using initgroups()
Oct 19 17:47:05 host1 nrpe[34977]: Warning: Could not set UID=992
Oct 19 17:47:06 hostt1 nrpe[34982]: Warning: Could not set effective GID=987
Oct 19 17:47:06 host1 nrpe[34982]: Warning: Unable to change supplementary groups using initgroups()
Oct 19 17:47:06 host1 nrpe[34982]: Warning: Could not set UID=992
Oct 19 17:47:11 host1 nrpe[34994]: Warning: Could not set effective GID=987
Oct 19 17:47:11 host1 nrpe[34994]: Warning: Unable to change supplementary groups using initgroups()
Oct 19 17:47:11 host1 nrpe[34994]: Warning: Could not set UID=992

Not sure what is the problem?