Werk #8025: Add all custom variables of host, service and contact to notification

Komponente The Checkmk Micro Core
Titel Add all custom variables of host, service and contact to notification
Datum 30.01.2014
Checkmk Edition Checkmk Enterprise (CEE)
Checkmk-Version 1.2.5i1
Level Bedeutende Änderung
Klasse Neues Feature
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen

The CMC now automatically adds all custom variables of hosts, service and contacts to the notification context. The variable name is prefixed with the word HOST, SERVICE or CUSTOM and - as its variable name custom - converted to upper case. So a host variable with the name _foobar will be available as HOST_FOOBAR in the notification context. The names will be prefixed with NOTIFY_ and put into the environment of the notification plugin. So at the end the variable will be available as NOTIFY_HOST_FOOBAR, e.g. in a shell script:

mynotify.sh

echo "Foobar: $NOTIFY_HOST_FOOBAR"

Notes

  • In the configuration files in main.mk or below conf.d the variables can be set via extra_host_conf or extra_service_conf. You need to have the variable names begin with an underscore. So a variable name of foobar is not allowed. You have to write either _foobar or _FOOBAR.
  • When you add contact custom variables via WATO (button Custom Attributes in the users management) the underscore will automatically be added.
  • when using Nagios as monitoring core you have to adapt check_mk_templates.cfg whenever you add a new custom variable.

Zur Liste aller Werks