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.
eloyd
Cool Title Here
Posts: 2129 Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:
Post
by eloyd » Tue Aug 12, 2014 7:25 am
When you execute this command on the remote server:
# /usr/lib/nagios/plugins/check_mailq -w 200 -c 400 -M qmail
CRITICAL: mailq is 558 (threshold c = 400)|unsent=558;200;400;0
It looks as though you are running as root.
Try running as nagios instead:
Code: Select all
su -l -c "/usr/lib/nagios/plugins/check_mailq -w 200 -c 400 -M qmail" nagios
pianunix
Posts: 51 Joined: Tue Jul 22, 2014 3:08 am
Post
by pianunix » Wed Aug 13, 2014 4:47 am
Still won't work at all.
Code: Select all
# su -l -c "/usr/lib/nagios/plugins/check_mailq -w 200 -c 400 -M qmail" nagios
#
eloyd
Cool Title Here
Posts: 2129 Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:
Post
by eloyd » Wed Aug 13, 2014 6:04 am
Then that is your problem. The nagios user cannot run the command. You will need to provide sudo access to nagios to be able to execute this command and then update your nrpe.cfg file to onclude the "sudo".
pianunix
Posts: 51 Joined: Tue Jul 22, 2014 3:08 am
Post
by pianunix » Wed Aug 13, 2014 6:29 am
Hi,
Okay this problem has been fixed.
Thanks
eloyd
Cool Title Here
Posts: 2129 Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:
Post
by eloyd » Wed Aug 13, 2014 6:38 am
Great! Just so others who may have the same problem can know for sure, was it the sudo that fixed it?
pianunix
Posts: 51 Joined: Tue Jul 22, 2014 3:08 am
Post
by pianunix » Wed Aug 13, 2014 11:10 pm
Hi,
yup i just added "sudo" into the nrpe.cfg
Code: Select all
command[check_mailq]=sudo /usr/lib/nagios/plugins/check_mailq -w200 -c500 -M qmail
eloyd
Cool Title Here
Posts: 2129 Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:
Post
by eloyd » Thu Aug 14, 2014 9:08 am
Great! Now the next person who searches for a similar solution will know!