NRPE
Ihab Samara
ihab24 at hotmail.com
Thu Dec 9 12:08:56 CET 2010
It is working now.
The requiretty on sudoers solved it, I used added this to sudoers, to allow the nagios user only:
Defaults:nagios !requiretty
Thanks Mark for the help
Ihab
> From: mark.elsen at gmail.com
> Date: Tue, 7 Dec 2010 17:30:51 +0100
> To: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] NRPE
>
> > Hi List
> >
> > I have a problem using check_nrpe:
> >
> > The script on the remote machine is running this command:
> >
> > #/bin/bash
> >
> > output=`sudo /usr/sbin/lsof -X |grep tomcat| wc -l`
> >
> > max=$1
> >
> > if [ "$output" -lt "$max" ]; then
> >
> > echo "OK |value is "$output""
> >
> > exit 0;
> >
> > else
> >
> > echo "CRITICAL value is "$output""
> >
> > exit 2;
> >
> > fi
> >
> > I have this line in sudoers file:
> >
> > nagios ALL=(ALL) NOPASSWD: /usr/sbin/lsof
> >
> > I have this in the nrpe.cfg:
> >
> > command[check_lsof]=/usr/local/nagios/libexec/check_lsof.sh 256
> >
> >
> > When I run the command from the nagios user on the remote machine:
> >
> > [nagios at serv_1]$ /usr/local/nagios/libexec/check_lsof.sh 256
> > OK |value is 132
> >
> > When I run it from the Nagios server (remotely):
> > [root at healthy libexec]# ./check_nrpe -H 10.1.1.1 -c check_lsof
> > OK |value is 0
> >
> >
> > Ive set the user in /etc/xinetd.d/nrpe to "nagios", and all the other checks
> > are working fine.
> >
> > Any thoughts?
> >
> >
>
> - Search for 'sudo' in nrpe.cfg , make sure the sudo prefix is set,
> not commented.
>
> - Look for 'tty' in the sudoers file, make sure 'requiretty' is commented.
>
> M.
>
> ------------------------------------------------------------------------------
> What happens now with your Lotus Notes apps - do you make another costly
> upgrade, or settle for being marooned without product support? Time to move
> off Lotus Notes and onto the cloud with Force.com, apps are easier to build,
> use, and manage than apps on traditional platforms. Sign up for the Lotus
> Notes Migration Kit to learn more. http://p.sf.net/sfu/salesforce-d2d
> _______________________________________________
> 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/20101209/7a6f032b/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
This SF Dev2Dev email is sponsored by:
WikiLeaks The End of the Free Internet
http://p.sf.net/sfu/therealnews-com
-------------- 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