check_ssh inquiry


#1

How can i use ssh on nagios. It always shows:

check_ssh: Port number must be a positive integer - -H

Here is my checkcommands:

‘check_ssh’ command definition

define command{
command_name check_ssh
command_line $USER1$/check_ssh -H
$HOSTADDRESS$ -p $ARG1$
}

Here is my service.cfg:

}
#SSH
define service{
host_name HOST1
service_description SSH
is_volatile 0
check_period 24x7
max_check_attempts 3
normal_check_interval 3
retry_check_interval 3
contact_groups NOC-admins
notification_interval 60
notification_period 24x7
notification_options d,c,r
check_command check_ssh! -H 192.168.0.8 -t 5
-p 3500
}

Is there something wrong in my config files?


#2

In services.cfg file, you don’t define -H ipaddy.
Look at your check_ping commands. They don’t have an IP addy in services.cfg do they?
check_command check_fping!200.0,20%!500.0,60%

See? no ip.

What you have in your services.cfg is :
$ARG1$ = -H 192.168.0.8 -t 5 -p 3500

This info is passed to your checkcommands defintion as this:
check_ssh -H 192.168.0.8 -p -H 192.168.0.8 -t 5 -p 3500
What you should have is this in services.cfg
check_command check_ssh!3500
Result would be
check_ssh -H 192.168.0.8 -p 3500

Why you have -t 5, I don’t know, but perhaps you might want to define that in the checkcommands file as an argument.


#3

thanks jakkedup it WORKS!!!

hope you continue your patience to a linux newbie like me :o