Open CVT-Adam opened 7 months ago
There is currently no support for multi-value-selection of variables in the host filter field.
As far as I can see you are using a commercial edition of checkmk, then you can use the following workaround: Instead of the "Hostname" Filter you can use the "Hostname Regex" and use the following as the value: ${variable_name:regex}
then Grafana will build a regex for you: https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/#regex and Checkmk should return the metrics for multiple hosts.
I've edited the formatting of your post and modified the title, I hope this does not alter the intention of your issue.
I'm not 100% sure, but it seems to me you might use {$variable_name}
, but the correct syntax is ${variable_name}
.
On my side, I'm using 2.2.0p14.cre. So ${variable_name:regex} does not work. We were using Pnp4Nagios plugin instead, but it not working anymore (https://github.com/sni/grafana-pnp-datasource/issues/77). So were stucked for the moment.
Sven Nierlein saved (again !!) my live by giving the solution : stay with pnp4nagios but the Consol-Monitoring one , see https://github.com/sni/grafana-pnp-datasource/issues/77
I am attempting to use a grafana variable in a dashboard to pull out several host that have a similar name.
variable is edfahost and definition is host:
{"host_name_regex":{"value":".*EDFA.*","negated":false}}
.In grafana the variable works in that the preview is pulling the 3 host correctly from my system. The issue comes when I attempt to use it in a graph as a filter -> hostname - $edfahost. To me it looks like the
"host": "{822-ERNE-GLEN-EDFA,822-ERNE-VALD-EDFA,835-VALD-ERNE-EDFA}"
portion shown below is the issue. If i use the checkmk swagger interactive api and hone this exact data down to just one host it works just fine but as soon as there is multiple host it fails.checkmk: 2.2.0p22 grafana-checkmk-datasource: 3.2.1 grafana: 10.4.1