Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service performance graph shows wrong graph of another service #103

Closed
straywarrior opened this issue Nov 17, 2017 · 10 comments
Closed

Service performance graph shows wrong graph of another service #103

straywarrior opened this issue Nov 17, 2017 · 10 comments

Comments

@straywarrior
Copy link

Service performance graph shows wrong graph of another service.

Expected Behavior

Each service performance graph get its own panelId and displays graph related to that service.

Current Behavior

All services of a host get the same panelId, for example, a host HOSTA has two different service PING (with actual panelId 1) and DISK (with actual panelId 2), service DISK also displays graph of service PING.

Possible Solution

This problem reflects the behavior of the code at library/Grafana/ProvidedHook/Grapher.php:154
It should be more reasonable to automatically query graph panelId from Grafana.

Steps to Reproduce (for bugs)

  1. Configure 2 services , service A(with panelId 1 in Grafana) and B (with panelId 2 in Grafana) for 1 host (in fact a host group) in Icinga2
  2. Install icingaweb2-module-grafana, import the two dashboards provided to Grafana. In grafana configuration, set default dashboard to base-metrics
  3. Open icingaweb2 service page and select service B. Graph of service A shows in the right column.

Context

A host has many services and all of them display the same performance graph with panelId 1. It's unpractical to configure graphs for all services manually.

Your Environment

  • Icinga Web 2 Grafana version (System - About): 1.1.7
  • Icinga Web 2 version and modules (System - About): 2.2.2
  • Version used (icinga2 --version): r2.7.2-1
  • Operating System and version: Ubuntu 16.04.3
  • Enabled features (icinga2 feature list): api checker command graphite ido-mysql mainlog notification
  • Config validation (icinga2 daemon -C):
information/cli: Icinga application loader (version: r2.7.2-1)
information/cli: Loading configuration file(s).
information/ConfigItem: Committing config item(s).
information/ApiListener: My API identity: icinga2-master
warning/ApplyRule: Apply rule 'satellite-host' (in /etc/icinga2/conf.d/satellite.conf: 29:1-29:41) for type 'Dependency' does not match anywhere!
information/ConfigItem: Instantiated 19 ApiUsers.
information/ConfigItem: Instantiated 1 ApiListener.
information/ConfigItem: Instantiated 20 Zones.
information/ConfigItem: Instantiated 1 FileLogger.
information/ConfigItem: Instantiated 19 Endpoints.
information/ConfigItem: Instantiated 2 NotificationCommands.
information/ConfigItem: Instantiated 51 Notifications.
information/ConfigItem: Instantiated 208 CheckCommands.
information/ConfigItem: Instantiated 1 Downtime.
information/ConfigItem: Instantiated 19 Hosts.
information/ConfigItem: Instantiated 1 IcingaApplication.
information/ConfigItem: Instantiated 4 HostGroups.
information/ConfigItem: Instantiated 1 Comment.
information/ConfigItem: Instantiated 1 UserGroup.
information/ConfigItem: Instantiated 3 TimePeriods.
information/ConfigItem: Instantiated 2 Users.
information/ConfigItem: Instantiated 101 Services.
information/ConfigItem: Instantiated 5 ServiceGroups.
information/ConfigItem: Instantiated 1 ScheduledDowntime.
information/ConfigItem: Instantiated 1 ExternalCommandListener.
information/ConfigItem: Instantiated 1 GraphiteWriter.
information/ConfigItem: Instantiated 1 IdoMysqlConnection.
information/ConfigItem: Instantiated 1 NotificationComponent.
information/ConfigItem: Instantiated 1 CheckerComponent.
information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
information/cli: Finished validating the configuration file(s).
@Myriagone
Copy link

Hello,

I have the same problem here. One other solution could be to enter a variable as dashboard name and having one per host.

@Mikesch-mp
Copy link
Owner

Please provide config.ini and also graphs.ini from the module. And please dont use base-metrics as default dashboard, use the default one provided with the module. Base metrics is only for configured graphs.

@straywarrior
Copy link
Author

Wow. I changed default dashboard to graphite-icinga2-default and problem solved. Amazing!

@Myriagone
Copy link

Nice, where is this option ? On Grafana or on Icinga ?

I have fix my problem by using NRPE, and create "nrpe-ping4-host1" "nrpe-ping4-host2" but your solution can be better !

@straywarrior
Copy link
Author

straywarrior commented Dec 26, 2017

It's an option of the IcingaWeb2 Grafana module. It can be found in /etc/icingaweb2/modules/grafana/config.ini or in Icinga Web User Interface (Configuration->Modules->grafana) . Though I have not understood how it works since I did not read all the codes.

@Myriagone
Copy link

I see.
Thk, i will try this solution.

@Myriagone
Copy link

I have a question, on icingaweb2, can you "add new grafana graph", and select on Name : "ping4" (so the same of the service) and apply to all host ?

In my case, i can't, because we have to select the "pannelID", and if Name is "ping4" and PannelID is "2", my all host will have the seconde graph on my Dashboard with ping...

I have solve it be renaming service, so i have on Name : "nrpe-ping4-host1" or "nrpe-ping4-host2... and of cause, after, i can choice the PanelID, that works, but it is boring ! If i whant check 10 ping, i have to create 10 graph !

@Mikesch-mp
Copy link
Owner

Do you graphite or influx?

@Myriagone
Copy link

Hello,
I use InfluxDB.
Thk.

@Mikesch-mp
Copy link
Owner

I solved it by editing the influxdb.conf of icinga2 and change the measurement line. I fill the variable via template for non nrpe or if nrpe with the real command.

  service_template = {
    measurement = "$service.vars.influx_command$"
    tags = {
      hostname = "$host.name$"
      service = "$service.name$"
      instance = "$service.vars.instance$"
    }

template Service "generic-service" {
  max_check_attempts = 3
  check_period = "24x7"
  check_interval = 5m
  retry_interval = 5m

  vars.influx_command = "$service.check_command$"
}

template Service "nrpe-generic-service" {
  import "generic-service"

  vars.influx_command = "$service.vars.nrpe_command$"
}

Then you have only to import the right template depending on your command. This should also work for by_ssh

Regards,
Carsten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants