<div dir="ltr">Is there a different plugin similar to check_smartmon I can try that works with check_nrpe ?<br><br>thanks in advanced.<br><br><br><br><br><div class="gmail_quote">On Tue, Aug 12, 2008 at 3:20 PM, Jake Solid <span dir="ltr"><<a href="mailto:richardsolid@gmail.com">richardsolid@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div dir="ltr">The following line will make all commands use sudo:<div class="Ih2E3d"><br><br>
command_prefix=/usr/bin/sudo<br><br></div>I remove the comment for command_prefix=/usr/bin/sudo and add the following to the sudoers file:<div class="Ih2E3d"><br><br>nagios    ALL=(ALL) NOPASSWD: /usr/sbin/smartctl,/usr/lib64/nagios/plugins/<br>

<br></div>Now, I get the NRPE: Unable to read output for any plugin that gets invoked.<br><br>The permissions of check_smartmon on the remote server are the same as the other plugins that are working.<br><br>-rwxr-xr-x 1 root root 8.4K Aug  6 13:02 check_smartmon<br>

<br><br>But I'm still not able to successfully invoke check_smartmon with check_nrpe from the nagios server.<div><div></div><div class="Wj3C7c"><br><br><br><br><div class="gmail_quote">On Tue, Aug 12, 2008 at 2:25 PM,  <span dir="ltr"><<a href="mailto:kyle.odonnell@gmail.com" target="_blank">kyle.odonnell@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I dont know if that will work, there is a specific option inside<br>
nrpe.cfg for executing commands via sudo:<br>
<br>
# COMMAND PREFIX<br>
# This option allows you to prefix all commands with a user-defined string.<br>
# A space is automatically added between the specified prefix string and the<br>
# command line from the command definition.<br>
#<br>
# *** THIS EXAMPLE MAY POSE A POTENTIAL SECURITY RISK, SO USE WITH CAUTION! ***<br>
# Usage scenario:<br>
# Execute restricted commmands using sudo.  For this to work, you need to add<br>
# the nagios user to your /etc/sudoers.  An example entry for alllowing<br>
# execution of the plugins from might be:<br>
#<br>
# nagios          ALL=(ALL) NOPASSWD: /usr/lib/nagios/plugins/<br>
#<br>
# This lets the nagios user run all commands in that directory (and only them)<br>
# without asking for a password.  If you do this, make sure you don't give<br>
# random users write access to that directory or its contents!<br>
<br>
# command_prefix=/usr/bin/sudo<br>
<br>
<br>
Also make sure you can run the command exactly like nrpe does as the<br>
user nrpe is running as.<br>
<br>
As for your bolded question, go chmod 644 check_load and try to run<br>
it, it will give you the same error.  It just means that the script<br>
executed but didn't respond with recognized output.<br>
<div><div></div><div><br>
On 8/12/08, Jake Solid <<a href="mailto:richardsolid@gmail.com" target="_blank">richardsolid@gmail.com</a>> wrote:<br>
> I did modified the nrpe.cfg to execute commands via sudo by adding the<br>
> following line:<br>
><br>
> *command[check_smartmon]=/usr/bin/sudo<br>
> /usr/lib64/nagios/plugins/check_smartmon  ata -d /dev/sda*<br>
><br>
> *Why I'm able to invoke the following plugins from the nagios server using<br>
> check_nrpe but when invoking check_smartmon  I get *NRPE: Unable to read<br>
> output*?*<br>
><br>
> command[check_users]=/usr/lib64/nagios/plugins/check_users -w 8 -c 10<br>
> command[check_load]=/usr/lib64/nagios/plugins/check_load -w 15,10,5 -c<br>
> 30,25,20<br>
> command[check_disk1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p<br>
> /dev/mapper/VolGroup00-LogVol00<br>
> command[check_disk2]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p<br>
> /dev/mapper/VolGroup00-LogVol01<br>
> command[check_disk3]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p<br>
> /dev/mapper/VolGroup00-LogVol02<br>
> command[check_disk4]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p<br>
> /dev/mapper/VolGroup01-LogVol00<br>
> command[check_md]=/usr/lib64/nagios/plugins/check_swraid<br>
> command[check_zombie_procs]=/usr/lib64/nagios/plugins/check_procs -w 5 -c 10<br>
> -s Z<br>
> command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 200 -c<br>
> 300<br>
><br>
><br>
><br>
> On Tue, Aug 12, 2008 at 12:25 PM, <<a href="mailto:kyle.odonnell@gmail.com" target="_blank">kyle.odonnell@gmail.com</a>> wrote:<br>
><br>
>> executing check_nrpe via sudo will not accomplish what you want.  You<br>
>> will need to either modify the nrpe.cfg to execute commands via sudo,<br>
>> or write a wrapper for check_smartmon.  I am not familiar with that<br>
>> plugin, but you may also be able to edit it and prepend /path/to/sudo<br>
>> before it execs smartctl.<br>
>><br>
>><br>
>><br>
>> On 8/12/08, Jake Solid <<a href="mailto:richardsolid@gmail.com" target="_blank">richardsolid@gmail.com</a>> wrote:<br>
>> > I'm trying to use check_nrpe with check_smartmon but I'm getting NRPE:<br>
>> > Unable to read output at the Nagios Server. *All other check plugins<br>
>> > like<br>
>> > check_load and check_procs work fine.<br>
>> > *<br>
>> > *I'm running the following command from my nagios server to the remote<br>
>> host:<br>
>> > *<br>
>> > *./check_nrpe -H <a href="http://remotehost.domain.com" target="_blank">remotehost.domain.com</a> -c check_smartmon*<br>
>> ><br>
>> > *and the out put is the following:*<br>
>> > *NRPE: Unable to read output*<br>
>> ><br>
>> > *This is what the remote host logs display:*<br>
>> > *Aug 12 11:16:13 *remotehost* xinetd[7151]: START: nrpe pid=7986 from=<br>
>> > <a href="http://198.162.1.1" target="_blank">198.162.1.1</a> <- Nagios Server IP Address<br>
>> > Aug 12 11:16:13 *remotehost* nrpe[7986]: INFO: SSL/TLS initialized. All<br>
>> > network traffic will be encrypted.<br>
>> > Aug 12 11:16:13 *remotehost* xinetd[7151]: EXIT: nrpe status=0 pid=7986<br>
>> > duration=0(sec)*<br>
>> ><br>
>> ><br>
>> > *When I use the check_smartmon directly in the remote machine as the<br>
>> > user<br>
>> > nagios and using sudo it works fine:*<br>
>> > [nagios@remotehost plugins]$  sudo<br>
>> /usr/lib64/nagios/plugins/check_smartmon<br>
>> > ata -d /dev/sda<br>
>> > OK: device is functional and stable (temperature: 33)<br>
>> ><br>
>> > *If I change the only_from line on  /etc/xinetd.d/nrpe file to<br>
>> > 127.0.0.1and<br>
>> > I run the following from the remote host I get prompted by a password:*<br>
>> > *[nagios@remotehost plugins]$ sudo /usr/lib64/nagios/plugins/check_nrpe<br>
>> -h<br>
>> > <a href="http://remotehost.domain.com.latpro.com" target="_blank">remotehost.domain.com.latpro.com</a> -c check_smartmon<br>
>> > Password:<br>
>> > *<br>
>> > *The permissions on the device are the following:*<br>
>> > *[nagios@remotehost plugins]$ ls -lah /dev/sda<br>
>> > brw-rw---- 1 root disk 8, 0 Jan  8  2008 /dev/sda*<br>
>> ><br>
>> > *The disk group also has nagios:*<br>
>> > disk:x:6:root,nagios<br>
>> ><br>
>> ><br>
>> > *And again the other plugins work fine when they are invoked from the<br>
>> Nagios<br>
>> > server. Like the following:*<br>
>> > [nagios@nagios-server plugins]$ ./check_nrpe -H <a href="http://remotehost.domain.com" target="_blank">remotehost.domain.com</a> -c<br>
>> > check_load<br>
>> > OK - load average: 2.14, 2.44, 2.72|load1=2.140;15.000;30.000;0;<br>
>> > load5=2.440;10.000;25.000;0; load15=2.720;5.000;20.000;0;<br>
>> ><br>
>> > *I added the following line on my remotehost to the /etc/sudoers:*<br>
>> > nagios    ALL=(ALL) NOPASSWD:<br>
>> ><br>
>> /usr/sbin/smartctl,/usr/lib64/nagios/plugins/check_nrpe,/usr/lib64/nagios/plugins/check_smartmon<br>
>> ><br>
>> > I also try running the NRPE as adeamon and not with xinetd and I had the<br>
>> > same issue.<br>
>> ><br>
>> > Any inputs?<br>
>> ><br>
>><br>
><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>