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
Post
by rlinux57 » Mon Feb 29, 2016 2:18 am
Check Locally:
Code: Select all
./check_eximailqueue -w 3 -c 4
Mailqueue OK - 0 messages on queue
Check from NMS:
Code: Select all
./check_nrpe -H IP_Address -c check_eximailqueue
[color=#FF0000]Mailqueue WARNING - query returned no output![/color]
cat /etc/sudoers:
Code: Select all
Defaults:nagios !requiretty
%nagios ALL=(ALL) NOPASSWD: ALL
nagios ALL=NOPASSWD:/usr/sbin/exim
nagios ALL=(ALL) NOPASSWD:/usr/lib64/nagios/plugins/
Please find check_eximailqueue attachment:
Attachments
check_eximailqueue.txt
(3.22 KiB) Downloaded 397 times
rkennedy
Posts: 6579 Joined: Mon Oct 05, 2015 11:45 am
Post
by rkennedy » Mon Feb 29, 2016 10:52 am
What is the result if you run the script on the client machine without NRPE?
Former Nagios Employee
rlinux57
Posts: 324 Joined: Mon Dec 08, 2014 12:03 am
Post
by rlinux57 » Mon Feb 29, 2016 2:01 pm
Code: Select all
./check_eximailqueue -w 3 -c 4
Mailqueue OK - 0 messages on queue
rkennedy
Posts: 6579 Joined: Mon Oct 05, 2015 11:45 am
Post
by rkennedy » Mon Feb 29, 2016 2:05 pm
Ah - for whatever reason I assumed that was on the XI server. What user are you running it as in the above command, and what are the permissions on check_eximailqueue?
Former Nagios Employee
rlinux57
Posts: 324 Joined: Mon Dec 08, 2014 12:03 am
Post
by rlinux57 » Mon Feb 29, 2016 2:11 pm
It's nagios core.
Code: Select all
ll /usr/lib64/nagios/plugins/check_eximailqueue
-rwxr-xr-x 1 root root 2417 Feb 29 08:01 /usr/lib64/nagios/plugins/check_eximailqueue*
rkennedy
Posts: 6579 Joined: Mon Oct 05, 2015 11:45 am
Post
by rkennedy » Mon Feb 29, 2016 2:18 pm
What happens if you change the permissions to nagios:nagios? I realize you're trying to run this through sudo rules, but I believe permissions are the issue at this point.
Also - when you ran the command above, was that as root or nagios?
Former Nagios Employee
rlinux57
Posts: 324 Joined: Mon Dec 08, 2014 12:03 am
Post
by rlinux57 » Mon Feb 29, 2016 2:21 pm
I have changed it to nagios.nagios but still same issue.
I have run that command as root user.
rkennedy
Posts: 6579 Joined: Mon Oct 05, 2015 11:45 am
Post
by rkennedy » Mon Feb 29, 2016 2:25 pm
Can you try running the command as nagios and post the result?
Former Nagios Employee
rlinux57
Posts: 324 Joined: Mon Dec 08, 2014 12:03 am
Post
by rlinux57 » Mon Feb 29, 2016 2:38 pm
How can i run command as nagios user whereas no shell given to nagios user ?
Code: Select all
nagios:x:988:984::/var/spool/nagios:/sbin/nologin
ssax
Dreams In Code
Posts: 7682 Joined: Wed Feb 11, 2015 12:54 pm
Post
by ssax » Mon Feb 29, 2016 2:44 pm
In the script it lists exim as this:
First find out which location is the right one and then you can adjust them to match.
Give that a try and let us know.