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

Re: Cant show exim queue

Post 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
jolson
Attack Rabbit
Posts: 2560
Joined: Thu Feb 12, 2015 12:40 pm

Re: Cant show exim queue

Post 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!
Twits Blog
Show me a man who lives alone and has a perpetually clean kitchen, and 8 times out of 9 I'll show you a man with detestable spiritual qualities.
pianunix
Posts: 51
Joined: Tue Jul 22, 2014 3:08 am

Re: Cant show exim queue

Post 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 ?
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

Re: Cant show exim queue

Post 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.
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Cant show exim queue

Post 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
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
pianunix
Posts: 51
Joined: Tue Jul 22, 2014 3:08 am

Re: Cant show exim queue

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

Re: Cant show exim queue

Post 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
Locked