mail queue error

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.
RubenLatorre
Posts: 20
Joined: Thu Feb 04, 2016 5:26 pm

Re: mail queue error

Post by RubenLatorre »

hsmith wrote:That looks all right.
jolson wrote:You may have to restart xinetd to get the new configuration to apply.
After you did this step, did the problem get resolved?
No, now it looks NRPE: UNABLE TO READ OUTPUT.

But it's rare because if i execute on the console the nrpe command manually "/usr/local/nagios/libexec/check_nrpe -H 192.168.9.110" the conection seems good, but if I execute

/usr/local/nagios/libexec/check_nrpe -H 192.168.9.110 -c check_mailq. The console shows on the screen the same than in the web interface.

Do you know why that happens? Because I have defined the command on nagios host and on the 192.168.9.110 host, on /usr/local/nagios/libexec
Attachments
Captura16.PNG
Captura16.PNG (9.02 KiB) Viewed 2424 times
Captura15.PNG
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: mail queue error

Post by rkennedy »

On the client machine, what are the permissions for /usr/local/nagios/libexec/check_mailq set to?

Code: Select all

ls -l /usr/local/nagios/libexec/check_mailq
Former Nagios Employee
RubenLatorre
Posts: 20
Joined: Thu Feb 04, 2016 5:26 pm

Re: mail queue error

Post by RubenLatorre »

rkennedy wrote:On the client machine, what are the permissions for /usr/local/nagios/libexec/check_mailq set to?

Code: Select all

ls -l /usr/local/nagios/libexec/check_mailq
Attachments
Captura17.PNG
Captura17.PNG (8.04 KiB) Viewed 2420 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: mail queue error

Post by rkennedy »

Can you try changing the permissions to apache:nagios? This seems to be permission related.

NRPE will run as the nagios user, and because the script check_mailq is root:root on the remote server, it won't be able to execute it.
Former Nagios Employee
RubenLatorre
Posts: 20
Joined: Thu Feb 04, 2016 5:26 pm

Re: mail queue error

Post by RubenLatorre »

rkennedy wrote:Can you try changing the permissions to apache:nagios? This seems to be permission related.

NRPE will run as the nagios user, and because the script check_mailq is root:root on the remote server, it won't be able to execute it.
I don't have any apache group on the remote host, the nagios user is on de administrator group.

I have changed root:root to nagios:administrators and I have restarted de services, and it looks the same warning: "NRPE: Unable to read output".
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: mail queue error

Post by rkennedy »

What is the full output of the folder? -

Code: Select all

ls -l /usr/local/nagios/libexec/
Former Nagios Employee
RubenLatorre
Posts: 20
Joined: Thu Feb 04, 2016 5:26 pm

Re: mail queue error

Post by RubenLatorre »

rkennedy wrote:What is the full output of the folder? -

Code: Select all

ls -l /usr/local/nagios/libexec/

The longer result is about nagios host, and the shorter is about remote host
Attachments
Captura19.PNG
Captura18.PNG
Captura18.PNG (6.49 KiB) Viewed 2399 times
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: mail queue error

Post by rkennedy »

I believe the remote host has the wrong permissions for check_mailq. Try running -

Code: Select all

chown nagios:nagios check_mailq
Former Nagios Employee
Locked