HI,
I have a strange problem where the following config not add the -C Argument to the by_ssh check. Only if use override vars inside the director with exact the same value its working:
object CheckCommand "by_ssh_director_o" {
import "plugin-check-command"
import "by_ssh_director"
vars.by_ssh_identity = "/var/lib/nagios/.ssh/mon.id_rsa"
vars.by_ssh_logname = "mon"
vars.by_ssh_options = "StrictHostKeyChecking=no"
}
object CheckCommand "by_ssh_director" {
import "ipv4-or-ipv6"
command = [ PluginDir + "/check_by_ssh" ]
arguments = {
"-H" = {
value = "$host.address$"
description = "Host name, IP Address, or unix socket (must be an absolute path)"
}
"-p" = {
value = "$by_ssh_port$"
description = "Port number (default: none)"
}
"-C" = {
value = "$by_ssh_command$" + " " + "$by_ssh_arguments$"
description = "The Check Command including path and Arguments"
}
"-l" = {
value = "$by_ssh_logname$"
description = "SSH user name on remote host [optional]"
}
"-i" = {
value = "$by_ssh_identity$"
description = "identity of an authorized key [optional]"
}
"-q" = {
set_if = "$by_ssh_quiet$"
description = "Tell ssh to suppress warning and diagnostic messages [optional]"
}
"-w" = {
value = "$by_ssh_warn$"
description = "Response time to result in warning status (seconds)"
}
"-c" = {
value = "$by_ssh_crit$"
description = "Response time to result in critical status (seconds)"
}
"-t" = {
value = "$by_ssh_timeout$"
description = "Seconds before connection times out (default: 10)"
}
"-o" = {
value = "$by_ssh_options$"
description = "Provide ssh options (may be repeated)"
}
"-4" = {
set_if = true
description = "Use IPv4 only"
}
"-6" = {
set_if = "$by_ssh_ipv6$"
description = "Use IPv6 only"
}
"-E" = {
value = "$by_ssh_skip_stderr$"
description = "Ignore all or (if specified) first n lines on STDERR [optional]"
}
}
vars.by_ssh_quiet = false
}
template Service "disk_all_sap_ssh" {
import "generic-service"
check_command = "by_ssh_director_o"
check_interval = 10m
icon_image = "disk.png"
vars.by_ssh_arguments = "-c 10% -u GB -x tracefs --icritical=5% -A -I 'gvfs'"
vars.by_ssh_command = "$host.plugin_directory$/check_disk"
}
inspect command is showing:
‘/usr/lib/nagios/plugins/check_by_ssh’ ‘-4’ ‘-H’ ‘HOSTNAME’ ‘-i’ ‘/var/lib/nagios/.ssh/mon.id_rsa’ ‘-l’ ‘mon’ ‘-o’ ‘StrictHostKeyChecking=no’
So the “-C” Parameter is missing.
Now, when i override the vars.by_ssh_command = “$host.plugin_directory$/check_disk” with the exact same value in the director, its working again.