Page 2 of 2

Re: NRPE Unable to read output - ON CENTOS7 Server

Posted: Mon Jun 08, 2020 5:02 am
by mccrakem
Hi

[root@dwylbopemail03 ~]# grep nagios /etc/passwd
nagios:x:191:189::/var/spool/nagios:/sbin/nologin


[root@dwylbopemail03 ~]# /usr/lib64/nagios/plugins/check_mail_ratio
CRITICAL - Successful mail delivery ratio 0%

But when I run it from the GUI

DWYLBOPEMAIL03 (CentOS7)
[[email protected] ~]$ /usr/local/nagios/libexec/check_nrpe -H dwylbopemail03.ops-dev.pa-dev.knxa -t 30 -c check_mail_ratio
sh: /bin/sudo: Permission denied

But if I run the same command against DWYLBOPEMAIL01 (RHEL6)

[[email protected] ~]$ /usr/local/nagios/libexec/check_nrpe -H dwylbopemail01.ops-dev.pa-dev.knxa -t 30 -c check_mail_ratio
OK - Successful mail delivery ratio 99%

Re: NRPE Unable to read output - ON CENTOS7 Server

Posted: Mon Jun 08, 2020 4:11 pm
by ssax
You will need to test like this:

Code: Select all

[root@dwylbopemail03 ~]# su -s /bin/bash -c '/bin/sudo /usr/lib64/nagios/plugins/check_mail_ratio' nagios
What does that output?

What is the output of this command?

Code: Select all

ls -l /bin/sudo
Please attach the plugin:

Code: Select all

/usr/lib64/nagios/plugins/check_mail_ratio

Re: NRPE Unable to read output - ON CENTOS7 Server

Posted: Tue Jun 09, 2020 7:29 am
by mccrakem
Hi

[root@dwylbopemail03 ~]# su -s /bin/bash -c '/bin/sudo /usr/lib64/nagios/plugins/check_mail_ratio' nagios
CRITICAL - Successful mail delivery ratio 0%[root@dwylbopemail03 ~]#

[root@dwylbopemail03 ~]# ls -l /bin/sudo
---s--x--x. 1 root root 143184 Aug 4 2017 /bin/sudo

I have attached the check_mail_ratio file to the ticket
but to be able to upload it I had to add the .txt estension

Re: NRPE Unable to read output - ON CENTOS7 Server

Posted: Tue Jun 09, 2020 5:07 pm
by ssax
I labbed this up with the same info and directories as yours and it's working. We'll need to debug on a remote.

Please create a ticket for this and include a link back to this forum thread so we can get a remote session setup:

https://support.nagios.com/tickets/

Re: NRPE Unable to read output - ON CENTOS7 Server

Posted: Wed Jun 17, 2020 9:11 am
by mccrakem
Hi Sean

I have also replied within the Ticket

Thanks for your help on this, All is working now, this can be closed

Thanks

Re: NRPE Unable to read output - ON CENTOS7 Server

Posted: Wed Jun 17, 2020 3:28 pm
by ssax
Glad to help, locking the thread and marking it as resolved.