check_by_ssh

David Olbersen DOlbersen at stbernard.com
Tue Jan 20 22:49:55 CET 2004


Brian Hendrix wrote:

> No, not yet.
> 
> I am able to do the following from the command line:
> ssh -1 <hostname> <command>
> (without a passphrase)
> 
> I tried the check_by_ssh command with the "-1" (minus one) option from the
> command line: check_by_ssh -1 -H <hostname> -C <command>
> (without a passphrase)
> 
> Amazingly, it worked. I believe the "-1" says to use ssh protocol 1.

That is 100% correct.

> However, when I edit my services.cfg and checkcommands.cfg to include the new
> option, I get: ssh: connect to address 100.1.30.31 port 22: Connection refused
> 
> define service{
> use generic-service
> host_name casbtest
> service_description check_total_procs
> contact_groups dtroncall
> check_command check_by_ssh!check_procs 500 800
> }
> 
> # 'check_by_ssh' command definition
> define command{
> command_name check_by_ssh
> command_line $USER1$/check_by_ssh -H $HOSTADDRESS$ -C $ARG1$ -t 30 -1
> }

Not to be a detail-Nazi, but why have your command_line different from what works? Sure, it -shouldn't- make a difference. Did you try moving the -1 before the -H? Also, what about quoting the command? That is:

  $USER1$/check_by_ssh -1 -H $HOSTADDRESS$ -C '$ARG1$' -t 30

This is very close to what I have:

  $USER1$/check_by_ssh -t 30 -H $HOSTADDRESS$ -C "/usr/local/libexec/nagios/$ARG1$ $ARG2$"

Keep in mind I probably use it differently than you do:

  check_command check_by_ssh!check_load!-w 16 -c 20

-- 
David Olbersen 
iGuard Engineer
St. Bernard Software
15015 Avenue of Sciences
San Diego, CA 92127 
x2152


-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
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