Werk #8025 · Jan 30, 14
Add all custom variables of host, service and contact to notification
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_conforextra_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_foobaror_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.cfgwhenever you add a new custom variable.
Details
- Class:
- New Features
- Level:
- Prominent
- Component:
- CMC
- Versions:
- 1.2.5i1ProUltimate + MT