check_mailq plugin is not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
amit9876
Posts: 16
Joined: Mon Oct 22, 2018 9:05 am

check_mailq plugin is not working

Post by amit9876 »

hi, I am trying to use check_mailq plugin for one of my postfix mail server(rhel7). The plugin is executing locally on the mail server but throwing error from Nagios XI GUI or Nagios Server . Please let me know what needs to be done to use it.

Please note nagios user has sudo rights on the VM.


[nagios-prod@oc-monitoring-prod libexec]$ ./check_mailq -w 20 -c 50
ERROR: is not executable by (uid 1000:gid(1000 1000))

Thanks in advance..
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mailq plugin is not working

Post by scottwilkerson »

from the help for the plugin

Code: Select all

 This plugin uses the system mailq command (sendmail) or qmail-stat (qmail)
 to look at the queues. Mailq can usually only be accessed by root or
 a TrustedUser. You will have to set appropriate permissions for the plugin to work.
You may not have appropriate permission on mailq

Code: Select all

ls -l /usr/bin/mailq
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
amit9876
Posts: 16
Joined: Mon Oct 22, 2018 9:05 am

Re: check_mailq plugin is not working

Post by amit9876 »

hi ,

I do understand this is permission problem but I am not sure what needs to beset up . Could you help me in this.

lrwxrwxrwx. 1 root root 27 Oct 25 15:17 /usr/bin/mailq -> /etc/alternatives/mta-mailq

thanks..
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mailq plugin is not working

Post by scottwilkerson »

What are the permissions here

Code: Select all

ls -l /etc/alternatives/mta-mailq
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
amit9876
Posts: 16
Joined: Mon Oct 22, 2018 9:05 am

Re: check_mailq plugin is not working

Post by amit9876 »

hi,

lrwxrwxrwx. 1 root root 23 Oct 25 15:17 /etc/alternatives/mta-mailq -> /usr/bin/mailq.sendmail
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mailq plugin is not working

Post by scottwilkerson »

and then

Code: Select all

ls -l /usr/bin/mailq.sendmail
we need to follow the symlinks to the actual binary
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
amit9876
Posts: 16
Joined: Mon Oct 22, 2018 9:05 am

Re: check_mailq plugin is not working

Post by amit9876 »

thanks ..this worked..

but I had to install NRPE agent on client machine and define below command in nrpe.cfg

command[check_mailq]=/usr/local/nagios/libexec/check_mailq -w 50 -c 100


This is also very useful link for future reference.
http://uppayinix.blogspot.com/2010/09/n ... iling.html
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: check_mailq plugin is not working

Post by scottwilkerson »

amit9876 wrote:thanks ..this worked..

but I had to install NRPE agent on client machine and define below command in nrpe.cfg

command[check_mailq]=/usr/local/nagios/libexec/check_mailq -w 50 -c 100


This is also very useful link for future reference.
http://uppayinix.blogspot.com/2010/09/n ... iling.html
great glad you got it resolved!

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked