Page 2 of 2

Re: Plugins for queue email

Posted: Tue Aug 12, 2014 7:25 am
by eloyd
When you execute this command on the remote server:
# /usr/lib/nagios/plugins/check_mailq -w 200 -c 400 -M qmail
CRITICAL: mailq is 558 (threshold c = 400)|unsent=558;200;400;0
It looks as though you are running as root.

Try running as nagios instead:

Code: Select all

su -l -c "/usr/lib/nagios/plugins/check_mailq -w 200 -c 400 -M qmail" nagios

Re: Plugins for queue email

Posted: Wed Aug 13, 2014 4:47 am
by pianunix
Still won't work at all.

Code: Select all

# su -l -c "/usr/lib/nagios/plugins/check_mailq -w 200 -c 400 -M qmail" nagios
#

Re: Plugins for queue email

Posted: Wed Aug 13, 2014 6:04 am
by eloyd
Then that is your problem. The nagios user cannot run the command. You will need to provide sudo access to nagios to be able to execute this command and then update your nrpe.cfg file to onclude the "sudo".

Re: Plugins for queue email

Posted: Wed Aug 13, 2014 6:29 am
by pianunix
Hi,

Okay this problem has been fixed.

Thanks

Re: Plugins for queue email

Posted: Wed Aug 13, 2014 6:38 am
by eloyd
Great! Just so others who may have the same problem can know for sure, was it the sudo that fixed it?

Re: Plugins for queue email

Posted: Wed Aug 13, 2014 11:10 pm
by pianunix
Hi,

yup i just added "sudo" into the nrpe.cfg

Code: Select all

command[check_mailq]=sudo /usr/lib/nagios/plugins/check_mailq -w200 -c500 -M qmail

Re: Plugins for queue email

Posted: Thu Aug 14, 2014 9:08 am
by eloyd
Great! Now the next person who searches for a similar solution will know!