NRPE Unable to read output - ON CENTOS7 Server

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mccrakem
Posts: 129
Joined: Mon Jun 19, 2017 8:28 am

Re: NRPE Unable to read output - ON CENTOS7 Server

Post 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%
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRPE Unable to read output - ON CENTOS7 Server

Post 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
mccrakem
Posts: 129
Joined: Mon Jun 19, 2017 8:28 am

Re: NRPE Unable to read output - ON CENTOS7 Server

Post 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
You do not have the required permissions to view the files attached to this post.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRPE Unable to read output - ON CENTOS7 Server

Post 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/
mccrakem
Posts: 129
Joined: Mon Jun 19, 2017 8:28 am

Re: NRPE Unable to read output - ON CENTOS7 Server

Post 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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: NRPE Unable to read output - ON CENTOS7 Server

Post by ssax »

Glad to help, locking the thread and marking it as resolved.
Locked