Check_by_ssh

Dear Community,

i have again a short question.
in our old Icinga 1.8.4. we use this following command:

define command{
command_name check_tk_anrufe_zahlen
command_line /usr/bin/ssh mtcl@$HOSTADDRESS$ ./nagios_check_anrufe.sh
}

In the new Icinga2 i saw a soliution to use the check_by_ssh command.
I tried to apply, it, but im not sure if its correct.
Maybe some one can give me a short reply.

object Service “Eing. Anrufe " {
host_name = “SER-TEST-1”
check_command = “by_ssh”
vars.by_ssh_logname = “>user_name<”
vars.by_ssh_command = [”./nagios_check_anrufe.sh"]

}

F.

Hello,

it always helps to take a look at the command configuration itself.
Your service should work if:

  • SSH-key is copied to the destionation system and its the default key for icinga2 user
  • The script nagios_check_anrufe.sh is located in the homedirectory

Best practise i do is:

  • Use fullpathes for ssh_command
  • pass the ssh identy file to the plugin with full path
  • make by_ssh_command and/or by_ssh_arguments always an array

Regards,
Carsten