You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to create a Service which imports a Service Template. We have four different Service Templates, depending on the priority. My idea was to add a variable to the host and then import the specified service template.
The problem is that the icinga2_object.py script adds the import as string, not as variable. So the rendered config looks like this:
apply Service "CPU" {
import "host.vars.nb.service_priority"
check_command = "check_load"
command_endpoint = host.name
assign where "linux-hosts" in host.groups
vars.notification = true
}
But it should look like this (import without quotes):
apply Service "CPU" {
import host.vars.nb.service_priority
check_command = "check_load"
command_endpoint = host.name
assign where "linux-hosts" in host.groups
vars.notification = true
}
I'm not quite sure how this can be solved. Because sometimes the import should be a string, e.g. if I import priority1-service directly, but if it's a variable, it should be without quotes...
The text was updated successfully, but these errors were encountered:
I didn't know this was even possible within the DSL. Thanks, we basically need to detect if it is a custom var and then apply it. Does it work with constants as well? :D
I need to check if there's more clauses possible.
Hi all
I want to create a Service which imports a Service Template. We have four different Service Templates, depending on the priority. My idea was to add a variable to the host and then import the specified service template.
Here's an example Host object:
And here's the Service object that I want to create:
The problem is that the
icinga2_object.py
script adds the import as string, not as variable. So the rendered config looks like this:But it should look like this (import without quotes):
I'm not quite sure how this can be solved. Because sometimes the import should be a string, e.g. if I import
priority1-service
directly, but if it's a variable, it should be without quotes...The text was updated successfully, but these errors were encountered: