HI Ralph,<br><br>The point of running the following command on the nagios server:<br><br>"sudo -u nagios /usr/local/lib/nagios/linexec/check_nrpe -H remote.host -t 30 -c check_custom_plugin"<br><br>Was to make sure Nagios can run nrpe and retrieve the plugins output from the remote cluster node. When I run that command, I get a single line of text printed to stout and when I check the return value with "echo $?" I get the correct return value. So I guess the problem is not with nrpe (client or server) but something on the Nagios server side. As I can get results on the command line, but the nagios status grid on the webpage still shows "(No output!)".
<br><br>JB<br><br><br><div><span class="gmail_quote">On 17/01/2008, <b class="gmail_sendername"><a href="mailto:Ralph.Grothe@itdz-berlin.de">Ralph.Grothe@itdz-berlin.de</a></b> <<a href="mailto:Ralph.Grothe@itdz-berlin.de">
Ralph.Grothe@itdz-berlin.de</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi James,<br><br>I am not sure if my constraints are comparable to yours,
<br>but here's the method how I get around having nrpe run commands<br>that require elevated privileges.<br><br>Though in this simple case it would have been easy to just make<br>the /var/log/messages world readable on this nrpe node
<br>I didn't want to interfere with the policies of the owners/admins<br>of this host.<br>So I created a simple sudo rule that allows user nagios to<br>execute the command that I defined in nrpe.cfg<br>to parse the messages syslog file for entries from the kernel.
<br><br><br>The nrpe daemon is spawned by xinetd and runs under nagios' uid.<br><br>$ grep user /etc/xinetd.d/nrpe<br> user = nagios<br><br>The sudo rule for nagios allows him to run the check_log2.pl
<br>script (in contrib subdir of standard Nagios-Plugins)<br>under euid of root.<br><br>$ sudo -l<br>User nagios may run the following commands on this host:<br> (root) NOPASSWD:<br>/usr/lib64/nagios/plugins/contrib/check_log2.pl
<br><br><br>And this is how the nrpe command is defined<br><br>$ grep check_syslog /etc/nagios/nrpe.cfg<br>command[check_syslog_VMUNIX]=/usr/bin/sudo<br>/usr/lib64/nagios/plugins/contrib/check_log2.pl -l<br>/var/log/messages -s /tmp/messages.log_seek_kernel.txt -p kernel
<br><br><br>This would be called from the Nagios server as usual as<br><br>$USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$<br><br>with $ARG1$ being "check_syslog_VMUNIX" in my case<br>and passed in within the respective service definition.
<br><br>HTH<br><br><br>-----Original Message-----<br>From: <a href="mailto:nagiosplug-help-bounces@lists.sourceforge.net">nagiosplug-help-bounces@lists.sourceforge.net</a><br>[mailto:<a href="mailto:nagiosplug-help-bounces@lists.sourceforge.net">
nagiosplug-help-bounces@lists.sourceforge.net</a>]On Behalf<br>Of James Bewley<br>Sent: Wednesday, January 16, 2008 5:44 PM<br>To: <a href="mailto:nagiosplug-help@lists.sourceforge.net">nagiosplug-help@lists.sourceforge.net
</a><br>Subject: [Nagiosplug-help] NRPE returns correct data,while Nagios<br>shows "No Output"<br><br><br>Hi all,<br><br>I've written some custom plugins that monitor some software<br>around a cluster. I can run them on the individual cluster nodes
<br>with "sudo -u /usr/local/nagios/libexec/plugin.pl" and i get a<br>single line printed to stdout and the correct return value.<br><br>All looks good?<br><br>So then I run the nrpe client on the nagios server to retrieve
<br>the values returned from the plugin like so:<br>"sudo -u nagios /usr/local/nagios/libexec/check_nrpe -H<br>cluster_node -t 30 -c check_remote_plugin"<br><br>Which also prints the expected string and return value ( which is
<br>something like "plugin:OK blahh text \n")<br>and returns the correct value ( 0 in this OK state).<br><br>So far so good?<br><br>But when I go to the nagios servers web page (status grid) I get<br>WARNING "(No output!)"
<br><br>I've been scratching my head about this for a while now, can<br>anyone over a solution??<br><br>James<br>james at avbrief dot com<br></blockquote></div><br>