problem with check_yum

Seth Simmons ssimmons at cymfony.com
Thu Apr 16 06:18:44 CEST 2009


Thanks, that did it.
Wasn't sure if it was OS or nrpe; i also had issues before when trying to do check_mail with sudo but now it's obvious what the issue is.

-----Original Message-----
From: Matthias Flacke [mailto:Matthias.Flacke at gmx.de] 
Sent: Wednesday, April 15, 2009 11:19 PM
To: Seth Simmons
Cc: nagios Mailinglist
Subject: Re: [Nagios-users] problem with check_yum



Seth Simmons wrote:
> I think I found the problem.  When I ran check_yum locally I forgot it was running as root which explains why it worked.  Running locally as nagios caused the error.  Apparently it isn't the plugin.  If, as nagios, I run yum check-update it tells me I need to be root to access RHN repositories.  Seems CentOS doesn't have that requirement with yum, which explains why it works on all of those systems.
> 
> Running check_yum as nagios locally with sudo (nagios ALL=NOPASSWD: /usr/local/nagios/libexec/check_yum) for that one binary works.
> 
> Problem now is, using the plugin with sudo through nrpe.  When I try to run through nrpe it returns "unable to read output".
> 
> This is the command:
> command[check_yum_rhn]=/usr/bin/sudo /usr/local/nagios/libexec/check_yum
> 
> been looking around and some have had the same problem; often fixed by adding the complete path to sudo, but it isn't working here.

It seems that your /etc/sudoers contains a line

'Defaults requiretty'

If you comment it, also connections without a real tty are allowed
to run sudo commands.

-Matthias

------------------------------------------------------------------------------
Stay on top of everything new and different, both inside and 
around Java (TM) technology - register by April 22, and save
$200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
300 plus technical and hands-on sessions. Register today. 
Use priority code J9JMT32. http://p.sf.net/sfu/p
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list