Plugins for queue email

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

Re: Plugins for queue email

Post by eloyd »

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
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: Plugins for queue email

Post by pianunix »

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

Re: Plugins for queue email

Post by eloyd »

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".
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: Plugins for queue email

Post by pianunix »

Hi,

Okay this problem has been fixed.

Thanks
User avatar
eloyd
Cool Title Here
Posts: 2129
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Plugins for queue email

Post by eloyd »

Great! Just so others who may have the same problem can know for sure, was it the sudo that fixed it?
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: Plugins for queue email

Post by pianunix »

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

Re: Plugins for queue email

Post by eloyd »

Great! Now the next person who searches for a similar solution will know!
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoydI'm a Nagios Fanatic!
Locked