Problems with check_by_ssh
Marc Powell
marc at ena.com
Thu Mar 16 17:13:29 CET 2006
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> admin at lists.sourceforge.net] On Behalf Of Heiko Jaberg
> Sent: Thursday, March 16, 2006 8:54 AM
> To: nagios-users at lists.sourceforge.net
> Subject: [Nagios-users] Problems with check_by_ssh
>
> Hi,
>
> I encounter some problems using check_by_ssh.
> Im trying to grep some version information from a header file on a
> remote host.
>
> Both of the following command lines generate the desired information
> when called
> directly from the shell. But only the second line works when scheduled
> by Nagios.
> The second one produces the error "No output".
>
> Whats wrong here ?
>
>
> 1.)
> command_line $USER1$/check_by_ssh -i
/export/home/nagios/.ssh/id_rsa
> -l user -H $HOSTADDRESS$ -C 'if [ -e /usr/local/ACE/VERSION ]; then
> echo `head -1 /usr/local/ACE/VERSION`; else echo No ACE found; fi'
>
> 2.)
> command_line $USER1$/check_by_ssh -i
> /export/home/nagios/.ssh/id_rsa -l user -H $HOSTADDRESS$ -C 'head -1
> /usr/local/ACE/VERSION'
While not specifically addressing your question, you're using the
check_by_ssh plugin in an unintended manner. It's designed to execute
Nagios plugins on remote hosts and simply acts as a proxy for the plugin
return code and output. As such, the command you are running must comply
with the plugin output standards in order to work correctly with
check_by_ssh and Nagios --
http://nagiosplug.sourceforge.net/developer-guidelines.html#PLUGOUTPUT
You'll need to pay special attention to exiting with the correct exit
code and only 1 line of output (you've got the latter covered). That
might change your approach some and negate the need to troubleshoot
further.
I suspect that you might be encountering a permissions problem related
to /usr/local/ACE/VERSION or an environment issue where 'head' isn't in
the default path. Try specifying the full path to head.
--
Marc
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
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