grafana-checkmk-datasource icon indicating copy to clipboard operation
grafana-checkmk-datasource copied to clipboard

Support for Variables

Open Brazier85 opened this issue 5 years ago • 15 comments

It would be nice if you can use variables in the provided fields eg. host. So it is possible to create dynamic dashboards with rows.

image

Brazier85 avatar Dec 03 '19 10:12 Brazier85

+1

cstegm avatar Oct 28 '20 10:10 cstegm

+1

doctore74 avatar Oct 28 '20 15:10 doctore74

+1

mpeuser avatar Oct 28 '20 15:10 mpeuser

This feature is very much needed. Iam trying to aggregate data from multiple sources for a single host that id like be able to select from a list. I dont want to copy & pastet he same dashboard for each of the machines... Imagine if you change something and have to rework 100+ dashboards

ruohki avatar Feb 01 '21 14:02 ruohki

Happy to have your thoughts/help on this PR https://github.com/tribe29/grafana-checkmk-datasource/pull/38

:-)

amandahla avatar Feb 04 '21 19:02 amandahla

Really appreciate your PR, unfortunately several months old and still not merged

rs-ubaldi avatar Apr 20 '21 15:04 rs-ubaldi

@cbmueller Please take a look at the PR, we need this feature.

jeroenvermeulen avatar Nov 01 '21 23:11 jeroenvermeulen

Thanks for taking the time to participate. cbmueller is not working on the connector anymore.

In the background we are currently preparing the connector for the new Grafana API. It's more like a complete rewrite which has to be done because of changed APIs from the Grafana side. Once this is done and the existing features are working, we'll check out the feature requests and PRs.

We understand the need for this feature and will discuss it's priority internally.

LarsMichelsen avatar Nov 02 '21 06:11 LarsMichelsen

Please confirm if this feature is available now on the new plugins.

viramamur avatar Apr 07 '22 01:04 viramamur

Hi again,

as @LarsMichelsen also mentioned: We are aware, that this is a fundamental missing feature in the plugin. And even though, we currently do not know, when we will have the time to continue adding new features to this project, this one will be next.

Also, as we did most recently a complete rewrite of the plugin, we will add it to the new version instead of to the old one. This is important, especially regarding possible PRs. As mentioned in other enhancement issues: We will come back to you, hopefully with good news and something to test. But please be patient with us as it may take some time.

Best Regards, Marcel

godspeed-you avatar Apr 13 '22 12:04 godspeed-you

Hi Marcel,

Any news on the variable support yet?

sowdenraymond avatar Aug 25 '22 15:08 sowdenraymond

We are currently in requirements research for this feature. You can help us by answering the following question: How do you want to use variables with this data source? Please describe your use case as detailed as possible, so we can understand what you want to accomplish.

Example:

  • Purpose: Quick overview of the most important metrics of a single host
  • Variables:
    • "Host" is a list of all hosts
  • Dashboard:
    • Panel "Memory"
      • Filter Hostname: $Host
      • Filter Service: "Memory"
      • Template: "Active and Inactive Memory"
    • Panel "CPU"
      • Filter Hostname: $Host
      • Filter Service: "CPU utilization"
      • Template: "CPU utilization"
    • Panel "Disks"
      • similar to above
    • Panel "Network"
      • similar to above

BenediktSeidl avatar Aug 31 '22 13:08 BenediktSeidl

Hi Benedikt,

On the Panel screen after selecting the CheckMK datasource, hostname is currently a drop down list, to select a list of hosts configured in CheckMK. We should be able to enter a variable here like $dbserver, then configure a variable on the dashboard that points $dbserver to the hostname, so that it resolves.

In our case we have hundreds of panels, so if we configure a new dashboard, or change a hostname, we need to go and touch every single panel and select the correct host name from the list, whereas previously we could just change the dashboard variables, and not have to touch any of the panels.

Hope this helps, let me know if you want more info.

Regards

Raymond

sowdenraymond avatar Sep 01 '22 10:09 sowdenraymond

Hi @BenediktSeidl , we also need support for variables. Especially a hostname variable. In checkmk 2.1 there is already a server dashboard which shows the current performance of a system. We would like to recreate something like this in Grafana, especially with the selection of historical data. Currently, however, it looks as if it is not possible to use a variable for the hostname. So I always have to select the hostname manually in the query. I would like to be able to select a host directly in the grafana dashboard at the top via drop-down or text field + hostname auto completion and make the dashboard dynamic. We are using the checkmk enterprise Edition.

Regards Christian

cf-rewe avatar Sep 19 '22 09:09 cf-rewe

Hi @BenediktSeidl , As most of the people has pointed out, there will be great if we were able to use grafana variables onto the hostame or hostnameRegex fields on the checkMK plugin.

Here's the link to the official grafana plugin development documentation section that references how to implement this feature:

https://grafana.com/docs/grafana/latest/developers/plugins/add-support-for-variables/

Hope it helps.

Pau

paubartoli avatar Sep 29 '22 07:09 paubartoli

Hi @BenediktSeidl,

Any update on this?

We are currently grandfathered in on our version of CheckMK, and we cannot upgrade until we get this functionality, so it is a bit of a security worry..

Regards

Raymond

sowdenraymond avatar Mar 24 '23 08:03 sowdenraymond

it's definitely the next feature on our roadmap. i want to release the next beta of version 3.0.0 of the plugin this week, after that we will work on the variable support.

BenediktSeidl avatar Mar 27 '23 06:03 BenediktSeidl

If you want to test the pre-alpha version of the plugin with variable support, you can so tribe-29-checkmk-datasource-3.0.1-alpha.1.testbuild.5079989444 (the plugin is zipped twice, sorry) Please report any bugs or problems regarding the variables in this issue. Currently supported variable types are site, host and service. If you need other variables, please report here and describe your use case.

BenediktSeidl avatar May 25 '23 13:05 BenediktSeidl

Hi Benedikt,

Thanks, I have loaded the pre-alpha version.

Some comments: I selected CheckMK < 2.2 for the version of CheckMK, and the Raw Edition as we are running CheckMK 2.0.0p9, this tested fine!

Then when adding a panel, the Site dropdwon does not work, it does not list the current site, and i cannot type in this filed, it just says "Invalid ident: sites"

The hostname picks up the dashboard variables now, thank you!

Then I select the service, and single metric for the graph type, but the drop down for single metric, does not return only the counters for the single metric I selected, it seems to return all the counters available.

Let me know if you need any screenshots or similar.

sowdenraymond avatar May 26 '23 10:05 sowdenraymond

Hi Benedikt,

I updated CheckMK to 2.2.0 and Grafana to 9.5.2, and everything works on the latest versions.

This is awesome!

Thank you :)

sowdenraymond avatar May 29 '23 12:05 sowdenraymond

Nice to hear! I created a new internal note for changing the version dropdown to make it clear that 2.0.0 is not fully supported.

BenediktSeidl avatar May 30 '23 06:05 BenediktSeidl

Great work. I'm using checkmk 2.1p28 raw-edition and grafana 9.5.2 Everything seems to work

  • fill variables using checkmk queries, with graphical filter definition (awsome)
  • use variables in visualizations

This is quite exactly what I needed.

Thank you!

jsandner avatar May 31 '23 10:05 jsandner

I just released 3.1.0-beta.1 which is the first (pre-)release with variable support: https://github.com/Checkmk/grafana-checkmk-datasource/releases/

BenediktSeidl avatar Jun 13 '23 10:06 BenediktSeidl

As you may have noticed already, the support for variables is now fully implemented and released. We know this has been a long wanted and urgently needed feature and so, we want to thank all of you who participated during this process and for your patience. The input, not only in this particular issue, but on other platforms as well, has been of much value and gave us the ability to add actual value to the plugin.

godspeed-you avatar Jul 05 '23 12:07 godspeed-you

So, how does this work exactly? I updated to the latest plugin version, could variables allow me to monitor uptimes of multiple hosts in a single dashboard without having to specify every host individually but with a regex instead?

dnlldl avatar Jul 28 '23 21:07 dnlldl

please use the forum and tag it with grafana for general help questions regarding checkmk and grafana.

BenediktSeidl avatar Jul 31 '23 06:07 BenediktSeidl