check_by_ssh

Robert Fitzpatrick lists at webtent.net
Thu Nov 9 20:11:24 CET 2006


On Thu, 2006-11-09 at 10:51 -0600, Marc Powell wrote:
> You must be running something different from the command line as the
> above could never work. Check_by_ssh is expecting -C to be a full path
> and command to run on a remote host. I'm doing the same kind of thing
> with --
Yes, I was running the check_nagios on the remote server.

> 
> 
> define command {
>     command_name                   check_nagios
>     command_line                   $USER1$/check_by_ssh -H $HOSTADDRESS$
> -C "/usr/local/nagios/libexec/check_nagios
> /usr/local/nagios/var/status.dat 5 'bin/nagios'"
>     }
> 
> You're telling it to run the command "-e 60 -F ..." on the remote host
> which isn't valid and since it starts with '-e' that check_by_ssh is
> going to interpret that as an option to itself.
> 
Thanks! Got it working and now trying to add another server to the
hostgroup. Unbelievably, it works from the command line, but reports
'Host key verification failed' in the log and sends notifications. I run
this from the command line and it works with no password required...

genoa# /usr/local/libexec/nagios/check_by_ssh -H <host IP> -l <snip> -i <snip> -C "/usr/local/libexec/nagios/check_nagios /var/spool/nagios/status.dat 5 '/usr/local/bin/nagios'"
NAGIOS OK: 1 process, status log updated 5 seconds ago
genoa# tail -1 /var/spool/nagios/nagios.log
[1163098643] SERVICE ALERT: esmtp-ky;NAGIOS;WARNING;HARD;3;Host key verification failed.

Here is the setup, the esmtp host is working fine and reporting OK:

define hostgroup{
        hostgroup_name  nagios-servers
        alias           Nagios Servers
        members         esmtp,esmtp-ky
        }

define host{
        use                     generic-host                ; Name of host template to use
        host_name               esmtp-ky
        alias                   KY Mail Gateway
        address                 <host IP>
        }


How is this possible? Both remote servers have the same key in their
authorized_keys file and like you can see from above, it works from the
command line flawlessly :(

-- 
Robert


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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