Page 2 of 3

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 2:49 pm
by rlinux57
In my case i.e "/usr/sbin/exim" , i have already set that path in script.

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 2:52 pm
by ssax
Ok, let's check sudoers and make sure it's a valid configuration:

Code: Select all

sudo -v

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 2:53 pm
by rlinux57
Getting no output.

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 2:55 pm
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).

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 3:01 pm
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.

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 3:15 pm
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.

Re: Check_Eximailqueue query returned no output!

Posted: Mon Feb 29, 2016 11:38 pm
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

Re: Check_Eximailqueue query returned no output!

Posted: Tue Mar 01, 2016 10:57 am
by ssax
What is the output of this:

Code: Select all

chage -l nagios
Thank you

Re: Check_Eximailqueue query returned no output!

Posted: Wed Mar 02, 2016 11:28 pm
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

Re: Check_Eximailqueue query returned no output!

Posted: Thu Mar 03, 2016 10:23 am
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