check_ssh inquiry


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

Here is my service.cfg:

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 -t 5
-p 3500

Is there something wrong in my config files?


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 -t 5 -p 3500

This info is passed to your checkcommands defintion as this:
check_ssh -H -p -H -t 5 -p 3500
What you should have is this in services.cfg
check_command check_ssh!3500
Result would be
check_ssh -H -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.


thanks jakkedup it WORKS!!!

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