Page 2 of 2

Re: Cant show exim queue

Posted: Tue Mar 24, 2015 2:50 am
by pianunix
Hi,

Still wont work and now i've got this error :

# /usr/lib/nagios/plugins/check_nrpe -H server45026x -c check_eximailqueue
Mailqueue WARNING - query returned no output!

Any solution for this ?

Thanks

Re: Cant show exim queue

Posted: Tue Mar 24, 2015 9:44 am
by jolson
There are a few troubleshooting procedures that I picked up from the exim plugin page: http://exchange.nagios.org/directory/Pl ... ue/details
You will also need to add the following to the /etc/sudoers file: "nagios ALL=NOPASSWD:/usr/local/exim/bin/exim"
When using with NRPE you need to comment out the Defaults requiretty line in the sudoers file.
I commented out the EXIM= line:

# default hard-coded # EXIM=/usr/local/exim/bin/exim


and replaced it with one that checks the location of exim:

EXIM=$(which exim)


and now the script works
Have you already gone through these procedures? Please read the page that I have linked above, it could be very useful. Thank you!

Re: Cant show exim queue

Posted: Tue Mar 24, 2015 10:00 pm
by pianunix
still not work and now have a different error

Code: Select all

usr/lib/nagios/plugins/check_nrpe -H server45026x -c check_eximailqueue
NRPE: Unable to read output
any idea ?

Re: Cant show exim queue

Posted: Wed Mar 25, 2015 11:09 am
by jdalrymple
I suggest you change user nagios shell from nologin to bash in /etc/passwd, su to nagios and try to run the command to see if there is any more terse output there. There almost definitely will be.

When done you should remember to replace bash with nologin for security reasons.

Re: Cant show exim queue

Posted: Wed Mar 25, 2015 11:31 am
by eloyd
Did you change the shell, as I said?
eloyd wrote:Nagios user on remote host needs a valid login shell, not disabled:
nagios:x:496:497::/var/spool/nagios:/sbin/nologin

Re: Cant show exim queue

Posted: Wed Mar 25, 2015 10:21 pm
by pianunix
i was desperate and now i'm creating my own bash scripts for monitor exim queue, but why still happening this :

Code: Select all

# /usr/lib/nagios/plugins/check_nrpe -H serverxxx -c exim_queue
NRPE: Unable to read output
But if im using the simple ssh commandline it was running just fine

Code: Select all

 ssh -i .ssh/id_dsa root@serverxxx /usr/lib64/nagios/plugins/eximqueue.sh 2>&1 
stdin: is not a tty
OK - 12 of queue email
Fyi server that act as monitoring are using debian squeeze, and the guest server are using centos 6.x,.

Any idea why this issue can't fix until now ?

Thanks

Re: Cant show exim queue

Posted: Wed Mar 25, 2015 10:53 pm
by pianunix
This problem has been fixed by editing my scripts and locate the path of sudo inside the scripts

Code: Select all

SUDO=/usr/bin/sudo
exim_queue=`$SUDO  -u root exim -bpc`

Code: Select all

~# /usr/lib/nagios/plugins/check_nrpe -H serverxxx -c  exim_queue
OK - 14 of queue email
Thanks all. Image