Mikesch-mp / icingaweb2-module-grafana

Grafana module for Icinga Web 2 (supports InfluxDB & Graphite)
https://icinga.com/community/
GNU General Public License v2.0
241 stars 94 forks source link

var-service is filled with var-command for Host Graphs #243

Closed gasmick closed 4 years ago

gasmick commented 4 years ago

Expected Behavior

var-service in the URL passed to Grafana is empty for Host graphs

Current Behavior

var-service in the URL passed to Grafana has the value of var-command for Host graphs

Possible Solution

Steps to Reproduce (for bugs)

  1. Look at the Graph URL in the Performance Graph Debug for any Host graph

Context

In default Grafana dashboards, used for both hosts and services, there will naturally be grafana Variable $service. With current behaviour it is filled with a non-existent value of var-command. This results in an empty panel graph, because grafana doesn't find the data for this service value. If it is passed as 'var-service=' then the value is set to None, and the panel graph shows host metric.

Your Environment

Mikesch-mp commented 4 years ago

Host checks != Service checks, see you influxdb or graphite writer configuration. Its clearly dokumented that you have to create a graph config for the command for host checks.

gasmick commented 4 years ago

This is the Influxdbwriter configuration:

host_template = {
  measurement = "$host.check_command$"
  tags = {
    hostname = "$host.name$"
  }
}
service_template = {
  measurement = "$service.check_command$"
  tags = {
    hostname = "$host.name$"
    service = "$service.name$"
  }
}

The documentation states:

For host you just need to use the check_command name as service name for the graph configuration.

and proceeds to show how a graph for hosts is added.

Accordingly, I have dozens of host graphs that all work properly.

What I have referred to is the default dashboard, which is shown when a new host check or service check is introduced, that doesn't have a corresponding dashboard entry in the "Graphs" list.

Please be so kind to point me to the right spot in the documentation, if i have missed it.

Mikesch-mp commented 4 years ago

https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/doc/04-graph-configuration.md#hosts