NRPE unable to read output
Hari Sekhon
hpsekhon at googlemail.com
Wed Feb 21 16:42:28 CET 2007
Thanks for the reply, I just tried that but unfortunately it still gave
the same result.
I have another sudo /etc/nagios/plugin and that works. Also, su-ing to
nagios and then running the command by hand works.
so I'm still stuck....
Hari Sekhon
Andy Shellam (Mailing Lists) wrote:
> I had this problem, and had to put the full path to sudo
> (/usr/bin/sudo) in nrpe's config.
>
> HTH
>
> Andy.
>
> Hari Sekhon wrote:
>> I know that nrpe works, I run over 100 checks via nrpe, and on this host
>> all other nrpe checks work.
>>
>> I don't know if it's really the sudo in the line because I have another
>> line which says
>>
>> command[check_another_plugin]=sudo /etc/nagios/another_plugin
>>
>> and this works fine when called via nrpe as such
>>
>> check_nrpe -H hostname -c check_another_plugin
>> OK: test ok
>>
>> If sudo was the problem, I would expect both checks to fail, but the
>> other one works fine.
>>
>> Also, I need to run the check with sudo because this check will not work
>> without root privs and my
>> nrpe runs under the nagios user.
>>
>> -h
>>
>> Hari Sekhon
>>
>>
>>
>> Lane, Jim wrote:
>>
>>> Hari: I think your problem is with the sudo in the line
>>>
>>> command[check_plugin]=sudo /etc/nagios/check_plugin
>>>
>>> Try it as
>>>
>>> command[check_plugin]=/etc/nagios/check_plugin
>>>
>>> and see how you get on. I run NRPE plugins as above on my systems and
>>> they work fine.
>>>
>>> HTH
>>>
>>> Jim Lane
>>>
>>> -----Original Message-----
>>> From: nagios-users-bounces at lists.sourceforge.net
>>> [mailto:nagios-users-bounces at lists.sourceforge.net] On Behalf Of Hari
>>> Sekhon
>>> Sent: February 21, 2007 8:04 AM
>>> To: Nagios Users mailinglist
>>> Subject: [Nagios-users] NRPE unable to read output
>>>
>>> Hi,
>>> I'm using NRPE to execute checks on remote hosts and am have problems
>>>
>>> with one plugin on just one machine. I have the plugin in the
>>> configuration of nrpe and execute
>>>
>>> /usr/nagios/libexec/check_nrpe -H hostname -c check_plugin
>>> NRPE: Unable to read output
>>>
>>> The definition of the command call in nrpe.cfg is as follows:
>>>
>>> command[check_plugin]=sudo /etc/nagios/check_plugin
>>>
>>> and I have the following line in /etc/sudoers:
>>>
>>> nagios ALL=(ALL) NOPASSWD: /etc/nagios/check_plugin
>>>
>>> NRPE is running as the nagios user. When logged in as root I can do
>>>
>>> su - nagios
>>> sudo /etc/nagios/check_plugin
>>> OK: test passed
>>>
>>> so I don't understand why it is saying no output.
>>>
>>> I tried changing the nrpe.cfg to have > /tmp/output.log 2>&1 at the end
>>> of it but the file /tmp/output.log was not created so I assume that
>>> there really was no output when run from the check_nrpe command.
>>> This works on all my other servers (most of which are Gentoo) and this
>>> one is RHEL4. SELinux is disabled. I can execute all other nrpe checks
>>> correctly on this server including another one which also uses sudo.
>>> The difference in Distro is the only thing I can think of but it even
>>> works from the command line. I am using nrpe 2.6.
>>>
>>> I have racked my brains but can't think of anything else.
>>>
>>> Any ideas on this?
>>>
>>> -h
>>>
>>>
>>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share your
>> opinions on IT & business topics through brief surveys-and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> 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
>>
>> !DSPAM:37,45dc4dfa18514730279235!
>>
>>
>>
>
>
> --
> Andy Shellam
> NetServe Support Team
>
> the Mail Network
> "an alternative in a standardised world"
>
> p: +44 (0) 121 288 0832/0839
> m: +44 (0) 7818 000834
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070221/49c7cb63/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
-------------- next part --------------
_______________________________________________
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