I’ve setup a CheckCommand with 2 parameters. Both parameters are taken from the host config and the values are derives. I would like to skip the second parameters whenever a host var is not existent.
So I used - set_if = “$host.test1$” but it doesn’t seem work. Maybe I’m not setting it up properly. I referred the documentation but couldn’t figure out the cause.
do you use icinga director.
as i remember that is a bug.
i had a similar problem with:
hosttemplate var → service templatevar → command
and icinga always thought that the var is not empty.
I did the following workaround:
adapt the script to ignoring the parameter if empty or “”
add quotation to the command var
so icinga always executes like that => command -parameter1 “test” - parameter2 “”