Check_Eximailqueue query returned no output!

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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_Eximailqueue query returned no output!

Post by rlinux57 »

In my case i.e "/usr/sbin/exim" , i have already set that path in script.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_Eximailqueue query returned no output!

Post by ssax »

Ok, let's check sudoers and make sure it's a valid configuration:

Code: Select all

sudo -v
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_Eximailqueue query returned no output!

Post by rlinux57 »

Getting no output.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_Eximailqueue query returned no output!

Post by ssax »

Ah, I think I see, change your /etc/sudoers entry from this:

Code: Select all

nagios          ALL=NOPASSWD:/usr/sbin/exim
To this:

Code: Select all

nagios          ALL=(ALL) NOPASSWD:/usr/sbin/exim
It's because it's trying to sudo -u (run it as a different user).
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_Eximailqueue query returned no output!

Post by rlinux57 »

I have change it as per your direction but no effect.

Moreover i have using xinetd on client machine:

Code: Select all

cat /etc/xinetd.d/nrpe 
# default: on
# description: NRPE (Nagios Remote Plugin Executor)
service nrpe
{
        flags           = REUSE
        socket_type     = stream
        port            = 5666
        wait            = no
        user            = nagios
        group           = nagios
        server          = /usr/sbin/nrpe
        server_args     = -c /etc/nagios/nrpe.cfg --inetd
        log_on_failure  += USERID
        disable         = no
        only_from       = NMS IP Address
}
I have also restart both services nrpe and xinetd after any change.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_Eximailqueue query returned no output!

Post by ssax »

Try running these commands on the remote server and see what the output gives you:

Code: Select all

su - nagios
/usr/bin/sudo -u root /usr/sbin/exim -bpc
Essentially, what it does is it runs that command and puts the output into a variable, it then checks the variable to see if the output is NULL and if it is it throws the error you are seeing.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_Eximailqueue query returned no output!

Post by rlinux57 »

Code: Select all

root@server [~]# su - nagios
Last login: Mon Feb 29 20:36:43 CET 2016 on pts/0
This account is currently not available.
root@server [~]# cat /etc/passwd | grep nagios
nagios:x:988:984::/var/spool/nagios:/sbin/nologin

Code: Select all

root@server [/usr/lib64/nagios/plugins]# sudo -u nagios exim -bpc
exim: permission denied
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_Eximailqueue query returned no output!

Post by ssax »

What is the output of this:

Code: Select all

chage -l nagios
Thank you
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Check_Eximailqueue query returned no output!

Post by rlinux57 »

Code: Select all

chage -l nagios
Last password change					: Feb 24, 2016
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: -1
Maximum number of days between password change		: -1
Number of days of warning before password expires	: -1
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Check_Eximailqueue query returned no output!

Post by ssax »

Can you try changing your /etc/passwd for nagios to:
- Note: You may need to change /bin/bash to whatver the location is of the executable.

Code: Select all

nagios:x:988:984::/var/spool/nagios:/bin/bash
Locked