<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
hrm, i don't run check_mem as root and it works fine.<BR>
 <BR>
Is the check_mem script owned by the nagios user and/or executable by the nagios user?<BR>
 <BR>
As for mailq, I would suggest SUDO as the best route.  You can configure very specific sudo permissions to only allow the Nagios user to run very specific commands.<BR><BR>-- <BR>Mat W. - <A href="http://www.techadre.com/">http://www.techadre.com</A><BR><BR><BR> <BR>> Date: Mon, 15 Jun 2009 10:59:10 -0700<BR>> From: kfreels@sendmail.com<BR>> To: nagios-users@lists.sourceforge.net<BR>> Subject: [Nagios-users] check_mailq, nrpe, and root perms on client<BR>> <BR>> Greetings!!!<BR>> <BR>> Errata: Nagios 3.0<BR>> <BR>> I have nrpe running quite well on several clients, but I am having some<BR>> problems with running root-perm'd commands on the client via nrpe. The<BR>> critical one I need is check_mailq, which calls the standard UNIX<BR>> "mailq" command, but there are also others (check_mem, check_log)<BR>> <BR>> The problem is that mailq requires root priv's to do this. Since I run<BR>> nrpe in daemon mode under the nagios user, it fails with: <BR>> <BR>> CRITICAL: Error code 78 returned from /usr/bin/mailq<BR>> <BR>> Just for sanity check, I su'd into the nagios user and tried to run it,<BR>> and it fails. I was able to get it working with sudo by adding the user<BR>> nagios to the client's sudoers with only that command, and then adding<BR>> the appropriate "sudo" in front of the check_mailq command in nrpe.cfg:<BR>> <BR>> command[check_mailq]=sudo /usr/local/nagios/libexec/check_mailq -w 50<BR>> -c 75<BR>> <BR>> It also works on the client as the nagios user.<BR>> <BR>> However, as sudo is designed to do, it logs every command run under it,<BR>> so I wind up getting an email for every instance the check is made.<BR>> Multiply that times several servers and services, and I am now getting<BR>> flooded with emails that are essentially unnecessary.<BR>> <BR>> I also thought of:<BR>> <BR>> -- running nrpe as "root" (not comfortable with that)<BR>> -- SUID on check_mailq<BR>> -- chown'ing check_mailq root:root<BR>> <BR>> I'm stumped....<BR>> <BR>> Any ideas are greatly appreciated! Thanks in advance!!<BR>> <BR>> <BR>> ....k <BR>> -=-=-=- <BR>> Kevin Freels<BR>> Director of Information Technology<BR>> Sendmail, Inc.<BR>> kfreels@sendmail.com 510/594.5572<BR>> <BR>> ------------------------------------------------------------------------------<BR>> Crystal Reports - New Free Runtime and 30 Day Trial<BR>> Check out the new simplified licensing option that enables unlimited<BR>> royalty-free distribution of the report engine for externally facing <BR>> server and web deployment.<BR>> http://p.sf.net/sfu/businessobjects<BR>> _______________________________________________<BR>> Nagios-users mailing list<BR>> Nagios-users@lists.sourceforge.net<BR>> https://lists.sourceforge.net/lists/listinfo/nagios-users<BR>> ::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. <BR>> ::: Messages without supporting info will risk being sent to /dev/null<BR><br /><hr />Windows Live™ SkyDrive™: Get 25 GB of free online storage.   <a href='http://windowslive.com/online/skydrive?ocid=TXT_TAGLM_WL_SD_25GB_062009' target='_new'>Get it on your BlackBerry or iPhone.</a></body>
</html>