Nagios cant show value of mail queue

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.
Locked
pianunix
Posts: 51
Joined: Tue Jul 22, 2014 3:08 am

Nagios cant show value of mail queue

Post 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
pianunix
Posts: 51
Joined: Tue Jul 22, 2014 3:08 am

Re: Nagios cant show value of mail queue

Post by pianunix »

^ Fixed, just comment the line of requiretty and this will solve the problem.

- http://kb.initso.at/2011/05/linuxnagios ... -run-sudo/
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Nagios cant show value of mail queue

Post 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!
Former Nagios employee
Locked