# Icinga + Grafana module question

**URL:** <https://community.icinga.com/t/icinga-grafana-module-question/1858>\
**Category:** Icinga Web\
**Created:** [August 1, 2019, 3:17pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858 "2019-08-01T15:17:41Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![wim.aerts](https://community.icinga.com/letter_avatar_proxy/v4/letter/w/958977/32.png) [@wim.aerts](https://community.icinga.com/u/wim.aerts)\
**Post date:** [August 1, 2019, 3:17pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/1 "2019-08-01T15:17:41Z")

</div>

In grafana i’m using this dashboard: [https://grafana.com/grafana/dashboards/381](https://grafana.com/grafana/dashboards/381)

In Icinga i managed to add grafana graphs with the grafana module. This is working great for ping, load, …

But for disk i have to use the custom variables field for each partition i guess, however i cannot get this working.

Did anyone else manage to do this, and how ? Something like &var-disk=All in the field custom variables is not working for me.

Best regards,  
Wim

---

<div class="post-metadata">

**Author:** ![anon66228339](https://community.icinga.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@anon66228339](https://community.icinga.com/u/anon66228339)\
**Post date:** [August 2, 2019, 10:10am UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/2 "2019-08-02T10:10:49Z")

</div>

The docs read you must.

> **[Mikesch-mp/icingaweb2-module-grafana](https://github.com/Mikesch-mp/icingaweb2-module-grafana/tree/master/doc)**
>
> Grafana module for Icinga Web 2 (supports InfluxDB & Graphite) - Mikesch-mp/icingaweb2-module-grafana

---

<div class="post-metadata">

**Author:** ![wim.aerts](https://community.icinga.com/letter_avatar_proxy/v4/letter/w/958977/32.png) [@wim.aerts](https://community.icinga.com/u/wim.aerts)\
**Post date:** [August 2, 2019, 12:58pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/3 "2019-08-02T12:58:08Z")

</div>

I posted the question after i read the docs. I have the correct graphs for / , /var and /boot in grafana, i just have no clue how to get them in icinga with this module. The variable the dashboard is using is $disk , but i just don’t get what to do next sorry.

Keep in mind that everything here is new for me (icinga, influxdb, grafana). Anyway thanks for the answer.

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [August 2, 2019, 1:45pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/4 "2019-08-02T13:45:10Z")

</div>

Hi,

everyone has a bad day, and just throwing in the docs URL without more hints is not very polite, that’s for sure. Still, it was faster than me working on 2.11 😘

The thing which might be of a problem here is that you’re using a sample dashboard for Icinga from [grafana.net](http://grafana.net).

The InfluxDB module for Icinga Web requires different dashboards to extract the graphs from it. This is described in [this step](https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/doc/02-installation.md#import-dashboards) - once that is done, you can proceed with modifying and adding the additional data.

> [@wim.aerts](#):
>
> But for disk i have to use the custom variables field for each partition i guess, however i cannot get this working.

I’m not sure what this means though, but adding a custom variable into a graph would also mean that the underlaying Grafana template needs to understand that - and use that in its search.

This [issue](https://github.com/Mikesch-mp/icingaweb2-module-grafana/issues/120) points to

> You need to use templating, see the docs for [influxdb](https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/doc/06-create-grafana-dashboards-influxdb.md) or [graphite](https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/doc/07-create-grafana-dashboards-graphite.md) on howto create dashboards.

Yet I am not sure if that’s really what you want. Can you post the service objects from your configuration, e.g. the disk services extracted from `icinga2 object list --type Service --name *disk*` to get a better idea? Also the graphs done thus far, how does the `disk` graph look like (screenshot)?

Last but not least, please also share the versions involved to allow others to try it out by themselves - Grafana, web module, Icinga Web 2 versions.

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![wim.aerts](https://community.icinga.com/letter_avatar_proxy/v4/letter/w/958977/32.png) [@wim.aerts](https://community.icinga.com/u/wim.aerts)\
**Post date:** [August 5, 2019, 9:50am UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/5 "2019-08-05T09:50:05Z")

</div>

Hi Michael,

I don’t mind being refered to the docs if it would help me. The dashboard i downloaded looks like this:

 ![image](https://community.icinga.com/uploads/default/original/2X/1/17c0ccfdb902e8f160b7365d48487067aa78b670.jpeg)

the disk graph looks like this:

 ![image](https://community.icinga.com/uploads/default/original/2X/4/407af4ad328ee864b5ac9c472775751814e100f2.png)

I can use all these graphs in icinga (ping, load, …).

The disk graph is the only problem. If i dont fill in the “custom vars field” i can actually see the graph in icinga:

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

But to also see the graph for /var or /boot i would have to use the custom variables field. If i look at my grafana URL in the screenshot below i’m guessing i would have to use something like &var-disk=/boot but that just doesnt work:

 ![image](https://community.icinga.com/uploads/default/original/2X/e/e1e547ac02683889ddb1339541a1f47fe17ed78a.jpeg)

The only solution i see atm. is create my own graphs for / , /var, /boot etc. and NOT use templating, because i can’t get it to work with the custom variables field.

i’m using:

- icingaweb2
- icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.5-1)
- grafana 6.2.5
- icingaweb2-module-grafana 1.3.5
- monitoring 2.7.0
- director 1.6.2
- incubator v0.3.0
- ipl v0.3.0
- reactbundle v0.6.0
- vspheredb 1.0.3
- grafana dashboard: [https://grafana.com/grafana/dashboards/381](https://grafana.com/grafana/dashboards/381)

My icinga is completely empty , except for the icingaserver itself atm. (i’m testing if i can actualy use icinga to replace our previous monitoring system, opsview)

Output of icinga2 object list --type Service --name _disk_:

Object ‘icinga-p-1.linux!disk’ of type ‘Service’:  
% declared in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53

- \_\_name = “icinga-p-1.linux!disk”
- action\_url = “”
- check\_command = “disk”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 68:3-68:24
- check\_interval = 60  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 28:3-28:21
- check\_period = “”
- check\_timeout = null
- command\_endpoint = “”
- display\_name = “disk”
- enable\_active\_checks = true
- enable\_event\_handler = true
- enable\_flapping = false
- enable\_notifications = true
- enable\_passive\_checks = true
- enable\_perfdata = true
- event\_command = “”
- flapping\_threshold = 0
- flapping\_threshold\_high = 30
- flapping\_threshold\_low = 25
- groups = []
- host\_name = “icinga-p-1.linux”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53
- icon\_image = “”
- icon\_image\_alt = “”
- max\_check\_attempts = 5  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 27:3-27:24
- name = “disk”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53
- notes = “”
- notes\_url = “”
- package = “\_etc”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53
- retry\_interval = 30  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 29:3-29:22
- source\_location
  - first\_column = 1
  - first\_line = 65
  - last\_column = 53
  - last\_line = 65
  - path = “/etc/icinga2/conf.d/services.conf”

- templates = [“disk”, “generic-service”]  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 26:1-26:34
- type = “Service”
- vars  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 70:3-70:16
- volatile = false
- zone = “”

Object ‘icinga-p-1.linux!disk /’ of type ‘Service’:  
% declared in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53

- \_\_name = “icinga-p-1.linux!disk /”
- action\_url = “”
- check\_command = “disk”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 68:3-68:24
- check\_interval = 60  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 28:3-28:21
- check\_period = “”
- check\_timeout = null
- command\_endpoint = “”
- display\_name = “disk /”
- enable\_active\_checks = true
- enable\_event\_handler = true
- enable\_flapping = false
- enable\_notifications = true
- enable\_passive\_checks = true
- enable\_perfdata = true
- event\_command = “”
- flapping\_threshold = 0
- flapping\_threshold\_high = 30
- flapping\_threshold\_low = 25
- groups = []
- host\_name = “icinga-p-1.linux”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53
- icon\_image = “”
- icon\_image\_alt = “”
- max\_check\_attempts = 5  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 27:3-27:24
- name = “disk /”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53
- notes = “”
- notes\_url = “”
- package = “\_etc”  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53
- retry\_interval = 30  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 29:3-29:22
- source\_location
  - first\_column = 1
  - first\_line = 65
  - last\_column = 53
  - last\_line = 65
  - path = “/etc/icinga2/conf.d/services.conf”

- templates = [“disk /”, “generic-service”]  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 65:1-65:53  
% = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 26:1-26:34
- type = “Service”
- vars  
% = modified in ‘/etc/icinga2/conf.d/services.conf’, lines 70:3-70:16
  - disk\_partitions = “/”

- volatile = false
- zone = “”

---

<div class="post-metadata">

**Author:** ![anon66228339](https://community.icinga.com/letter_avatar_proxy/v4/letter/a/c4cdca/32.png) [@anon66228339](https://community.icinga.com/u/anon66228339)\
**Post date:** [August 5, 2019, 12:51pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/6 "2019-08-05T12:51:34Z")

</div>

Dont use that dashboard, its a tech demo only and not made to use with the module. Use the provided dashboards that comes with the module!

---

<div class="post-metadata">

**Author:** ![dnsmichi](https://community.icinga.com/user_avatar/community.icinga.com/dnsmichi/32/7721_2.png) [@dnsmichi](https://community.icinga.com/u/dnsmichi)\
**Post date:** [August 5, 2019, 12:53pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/7 "2019-08-05T12:53:54Z")

</div>

Hi,

> [@wim.aerts](#):
>
> I can use all these graphs in icinga (ping, load, …).

That’s the first problem. The “Icinga 2 with InfluxDB” is a sample dashboard we (as in the Icinga team) created and uploaded to [grafana.net](http://grafana.net).

The Grafana module is a community module created by @anon66228339 and **does not** incorporate or know about this dashboard.

Therefore the first step is to import the correct dashboards required by the module. This is is described in [this step](https://github.com/Mikesch-mp/icingaweb2-module-grafana/blob/master/doc/02-installation.md#import-dashboards).

I don’t know whether “our” dashboard works with the Grafana module. In order to stay safe, I would continue with the module’s dashboards and also creating custom one’s based in its logic.

Unfortunately I lack InfluxDB knowledge (don’t like its query language), so I’m not sure if you can build repeating panels with different custom variable values being different disk names.

Cheers,  
Michael

---

<div class="post-metadata">

**Author:** ![wim.aerts](https://community.icinga.com/letter_avatar_proxy/v4/letter/w/958977/32.png) [@wim.aerts](https://community.icinga.com/u/wim.aerts)\
**Post date:** [August 5, 2019, 1:11pm UTC](https://community.icinga.com/t/icinga-grafana-module-question/1858/8 "2019-08-05T13:11:38Z")

</div>

Thanks for the replies, but i managed to get it working now with the 1.3.4 module (not 1.3.5).

My custom variable now is

&var-disk=/boot

I’m pretty sure this has something to do with why it didnt work for me in 1.3.5 [https://github.com/Mikesch-mp/icingaweb2-module-grafana/issues/212](https://github.com/Mikesch-mp/icingaweb2-module-grafana/issues/212)
