Page 1 of 1

Nagios cant show value of mail queue

Posted: Fri Mar 27, 2015 2:30 am
by pianunix
Hi,

Today i have a problem that queue email c ant show from the nagios monitoring :

Code: Select all

OK - Current queue is: 
But when i using a nagios user from the host server this was running fine, so wear that on the other serve this scripts running just fine

Code: Select all

dug:~# /usr/lib/nagios/plugins/check_nrpe -H serverA -c  exim_queue
OK -  Current queue is: 133
ciledug:~# /usr/lib/nagios/plugins/check_nrpe -H serverB -c  exim_queue
OK - Current queue is: 
As you can see on the serverA this script run with successfull, but in the other side on the serverB this script cant given the output.

The scripts that i was using definitely was same and not different.

Can anyone analyze this why this happening ?
And this is my scripts :

Code: Select all

#!/bin/bash
#EXIM=/usr/sbin/exim
LIMIT=500
SUDO=/usr/bin/sudo
exim_queue=`$SUDO  -u root exim -bpc`
if [[ "$exim_queue" -lt "$LIMIT" ]]; then
echo  "OK -  Current queue is: $exim_queue"
else 
echo "CRITICAL -  Current queue is: $exim_queue"
fi
Thanks

Re: Nagios cant show value of mail queue

Posted: Fri Mar 27, 2015 4:20 am
by pianunix
^ Fixed, just comment the line of requiretty and this will solve the problem.

- http://kb.initso.at/2011/05/linuxnagios ... -run-sudo/

Re: Nagios cant show value of mail queue

Posted: Fri Mar 27, 2015 8:57 am
by tmcdonald
Good to hear! I'll be closing this thread now, but feel free to open another if you need anything in the future!