Custom Variables are widely used in the NetEye 4 (Icinga) monitoring system in order to tag/add information to a host/service. In order to speed up setting these variables, users use the inheritance mechanism to inherit them from parent objects (i.e. hosts). This feature is very useful, but sometimes it can create some doubt about what we are using for a specific variable, because Icinga shows this information in this way:
As you can see, the service’s variable “foobar” inherits the value from the host, and if we want see to the actual value we have to look at it in the host overview:
To provide a solution to this issue, for some customers we install and configure the “icingaweb2-module-monitoringaddons” module (https://github.com/Thomas-Gelf/icingaweb2-module-monitoringaddons).
With this module we can configure a set of Host Custom Variables that will be shown on every Service detail view. You can download it via git and put it in /usr/share/icingaweb2/modules/monitoringaddons:
You can configure which variables must appear in the service section in the file /neteye/shared/icingaweb2/conf/modules/monitoringaddons/config.ini, just remember to use the syntax custom_var_name=”custom_var_label”, where the first field is the variable name and the second is the label:
[hostvars_on_services] foobar = "foobar" foobar1 = "Foobar NR1"
Then assign the proper permissions to the folder:
chown -R apache:icingaweb2 /neteye/shared/icingaweb2/conf/modules/monitoringaddons chown -R apache:root /usr/share/icingaweb2/modules/monitoringaddons
The result is the section called “Host Properties”, shown before the “Problem handling” section where the selected custom variables are shown: