<div dir="ltr">I did modified the nrpe.cfg to execute commands via sudo by adding the following line:<br><br><i>command[check_smartmon]=/usr/bin/sudo /usr/lib64/nagios/plugins/check_smartmon ata -d /dev/sda</i><br><br><b>Why I'm able to invoke the following plugins from the nagios server using check_nrpe but when invoking check_smartmon I get </b>NRPE: Unable to read output<b>?</b> <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 30,25,20<br>command[check_disk1]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol00<br>
command[check_disk2]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol01<br>command[check_disk3]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/mapper/VolGroup00-LogVol02<br>command[check_disk4]=/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /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 -s Z<br>command[check_total_procs]=/usr/lib64/nagios/plugins/check_procs -w 200 -c 300<br>
<br><br><br><div class="gmail_quote">On Tue, Aug 12, 2008 at 12:25 PM, <span dir="ltr"><<a href="mailto:kyle.odonnell@gmail.com">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;">
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>
<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
On 8/12/08, Jake Solid <<a href="mailto:richardsolid@gmail.com">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 like<br>
> check_load and check_procs work fine.<br>
> *<br>
> *I'm running the following command from my nagios server to the remote 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 user<br>
> nagios and using sudo it works fine:*<br>
> [nagios@remotehost plugins]$ sudo /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 <a href="http://127.0.0.1" target="_blank">127.0.0.1</a> and<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 -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 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>
> /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>
</div></div></blockquote></div><br></div>