[Nagiosplug-devel] check_mailq don't have permissions

Mike Lykov combr at reg.ru
Tue Dec 18 16:09:16 CET 2007


Hi all.


I try to use check_mailq for sendmail via nrpe.
i install 
check_mailq (nagios-plugins 1.4.8) 1.7

on remote server,  configure command in nrpe as here
command[check_mailq]=/usr/lib/nagios/plugins/check_mailq -w 100 -c -200
(all other nrpe command work well)

and try to use it from nagios server.

$ ./check_nrpe -H (remote server ip) -c check_mailq
CRITICAL: Error code 78 returned from /usr/bin/mailq

I think this is mean "no privilegies"
(I run nrpe via xinetd under "nrpe" user)

when i configure sudo and 
command[check_mailq]=/usr/bin/sudo /usr/lib/nagios/plugins/check_mailq -w 
100 -c -200

i get
$ ./check_nrpe -H (remote server ip) -c check_mailq
NRPE: Unable to read output

on remote host from "nrpe" user print:
$ /usr/lib/nagios/plugins/check_mailq -v -w 100 -c 200
/usr/bin/mailq = can not chdir(/var/spool/mqueue/): Permission denied
Program mode requires special privileges, e.g., root or TrustedUser.
 CRITICAL: Error code 78 returned from /usr/bin/mailq
$ id
uid=497(nrpe) gid=497(nrpe)
I put nrpe in sendmail trusted-users file, but no effect.

or
$ sudo /usr/lib/nagios/plugins/check_mailq -w 100 -c 200
OK: mailq (68) is below threshold (100/200)|unsent=68;100;200;0

but last variant can't work, when it run by nrpe, not a shell.

I can't find any answers in documentation, only standard options description, 
but i find that other users encounter same problems. 

Are there "the right way" and "the best practice" to run check_mailq via nrpe? 
How other people use it?  Maybe add some documentation about it?

Mike




More information about the Devel mailing list