# Variables with string and variable content are not resolved in UI (Causing also issues with Grafana plugin)

**URL:** <https://community.icinga.com/t/variables-with-string-and-variable-content-are-not-resolved-in-ui-causing-also-issues-with-grafana-plugin/8455>\
**Category:** Icinga Web\
**Tags:** grafana, icingaweb2, director, icinga2\
**Created:** [October 15, 2021, 2:17pm UTC](https://community.icinga.com/t/variables-with-string-and-variable-content-are-not-resolved-in-ui-causing-also-issues-with-grafana-plugin/8455 "2021-10-15T14:17:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fl0wx](https://community.icinga.com/user_avatar/community.icinga.com/fl0wx/32/2250_2.png) [@fl0wx](https://community.icinga.com/u/fl0wx)\
**Post date:** [October 15, 2021, 2:17pm UTC](https://community.icinga.com/t/variables-with-string-and-variable-content-are-not-resolved-in-ui-causing-also-issues-with-grafana-plugin/8455/1 "2021-10-15T14:17:22Z")

</div>

Hey all,

im not pretty sure which is the right category, so i posted it here with tags to the other possible ones.

i have many variables which consist of queries with placeholders, e.g.:  
`max by (k8s_cluster, pod) (rate(container_cpu_cfs_throttled_periods_total{container="$host.vars.kubernetes_appname$"}[5m]))`

The check is working without any issues and gets the resolved variables via commandline. But the UI shows:

 ![image](https://community.icinga.com/uploads/default/original/2X/c/ca96d7ff12876b2c2cf8c5965808c97b63068d3d.png)

Also if i try to use that variable for custom-var in the grafana plugin, i get the following result:  
`https://XXXXX/d/wdT3WdI7z/XXXXX-generic?var-hostname=k8s_XXX&var-service=generic_k8s_cpu_throttling&var-command=check_prometheus_query&var-query=max%20by%20(k8s_cluster,%20pod)%20(rate(container_cpu_cfs_throttled_periods_total%7Bcontainer%3D%22$host.vars.kubernetes_appname$%22%7D%5B5m%5D))&from=now-6h&to=now&orgId=1&viewPanel=2`

Here you can clearly see, that the variable wasnt resolved, but submitted as string.

What can i do to get the resolved variable here?

I use director to configure my hosts/services.

Give as much information as you can, e.g.

- Director version (System - About): 1.8.0
- Icinga Web 2 version and modules (System - About): 2.7.3
- Icinga 2 version (`icinga2 --version`): 2.11.3
- Operating System and version: Debian 10

---

<div class="post-metadata">

**Author:** ![fl0wx](https://community.icinga.com/user_avatar/community.icinga.com/fl0wx/32/2250_2.png) [@fl0wx](https://community.icinga.com/u/fl0wx)\
**Post date:** [October 28, 2021, 9:21pm UTC](https://community.icinga.com/t/variables-with-string-and-variable-content-are-not-resolved-in-ui-causing-also-issues-with-grafana-plugin/8455/2 "2021-10-28T21:21:02Z")

</div>

Any help on that? Couldn’t find a solution yet

---

<div class="post-metadata">

**Author:** ![fl0wx](https://community.icinga.com/user_avatar/community.icinga.com/fl0wx/32/2250_2.png) [@fl0wx](https://community.icinga.com/u/fl0wx)\
**Post date:** [November 14, 2021, 8:51pm UTC](https://community.icinga.com/t/variables-with-string-and-variable-content-are-not-resolved-in-ui-causing-also-issues-with-grafana-plugin/8455/3 "2021-11-14T20:51:16Z")

</div>

Can someone help me here pls?
