[Nagiosplug-help] NRPE returns correct data, while Nagios shows "No Output"

James Bewley jamesbewley at gmail.com
Thu Jan 17 09:39:50 CET 2008


HI Ralph,

The point of running the following command on the nagios server:

"sudo -u nagios /usr/local/lib/nagios/linexec/check_nrpe -H remote.host -t
30 -c check_custom_plugin"

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!)".

JB


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


More information about the Help mailing list