Werk #8025: Add all custom variables of host, service and contact to notification
Component | The Checkmk Micro Core |
Title | Add all custom variables of host, service and contact to notification |
Date | Jan 30, 2014 |
Checkmk Edition | Checkmk Enterprise (CEE) |
Checkmk Version | 1.2.5i1 |
Level | Prominent Change |
Class | New Feature |
Compatibility | Compatible - no manual interaction needed |
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
orextra_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.