I'm trying to make an action_url
which will dynamically link from IcingaWeb2 to Grafana graphs. I have it working up to a point, but I'd like to add another variable…the $SERVICECHECKCOMMAND$
service.check_command
variable, and it's not working…I assume I need to set that environment variable somewhere?
I'd like this to work:
action_url =
"http://grafana-server.example/grafana/dashboard/db/generic-check?var-device=$HOSTNAME$&var-check=$SERVICEDESC$&var-checkmetric=$SERVICECHECKCOMMAND$&var-datatype=perfdata&var-value=value"
$HOSTNAME$
and $SERVICEDESC$
are working.
I've added environment variables to the default template before, but that was for mail host/service notifications, I'm having no luck getting it to work for action_url
.
Anyone familiar with where I can set something like:
env = {
"SERVICECHECKCOMMAND" = "$service.check_command$",
"SERVICEDESC" = "$service.name$",
"HOSTNAME" = "$host.name$",
"SERVICEDISPLAYNAME" = "$service.display_name$",
}
for action_url
s? Or am I looking in the wrong direction?
Best Answer
You cannot really use macros for that, because *_url is a configuration field.
The web interfaces try to do some expansion, but can't handle everything.
I'd recommend something like this in
apply Service
:Hope that helps