Mailq using qmail: ERROR: is not executable by


I have qmail running on a separate server from nagios. I have mailq set up to check the status of qmail. This is the entry in checkcommands.cfg:


define command{
command_name check_mailq
command_line $USER1$/check_mailq -w 2000 -c 2500 -M qmail

Nagios gives me this error on the interface:

ERROR: is not executable by (uid 502:gid(502 502))

Do i need to create a user on the mail server with that uid and give it permissions to execute qmailctl? Or is it something else? Thanks for the help.



possibly creating a nagios usr (with no login shell) and assigning the files to this user with execution rights solves the problem.



Nagios should be running as user/group nagios/nagios.
The fiiles in the libexec directory should have permissions of 755 and nagios.nagios.
What are your libexec files setup as, and your check_mailq especially.


having the same issue

-r-xr-xr-x 1 nagios nagios 20730 May 18 13:32 check_mailq

thats permissions on file:

here is the error output of comand line

yoda# ./check_mailq -w 8 -c 15 -M qmail
ERROR: is not executable by (uid 0:gid(0 5 0 0))


That plugin checks on the local host and not on “your seperate server”.
try “-M sendmail” on your local host, instead of “-M qmail” and you will see that it most likely works.


well the Qmail is on this box, sendmail returns a good responce however the queue is empty (as it should be since I’m not running sendmail) I have disabled sendmail and am running qmail


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.


I run the command at root and still get the error.


okay step1 of the fix is in you need to specify the path to qmail.

step 2 still working on as it outputs garbage


Good find, thanks for sharing that.