CMK version: CMK Raw Edition 2.1.0p31
OS version: RHEL 8.6
Additional information: CMK Master server with 2 additional CMK instances in slave mode.
Context: I’ve created a new Custom Host Attribute, called environment, that I wanted to use in email notifications’ subject.
I modified one host and added a value to this attribute.
Then I created a custom email rule to use this variable en subject for Host and Services alerts. Like this: Check_MK: ($HOSTLABEL_environment$) $HOSTNAME$...
I’ve tested it with this host that I modified and it worked fine.
Problem: I modified this variable for all other hosts, but in the emails I don’t see the value, instead I get ($HOSTLABEL_environment$).
I tried to debug, adding the check that shows all the variables defined in the email message. The variable appears in the first host but not in the others.
Is this a bug? Or I’m missing some configuration step?
Thanks in advance four your time and support.
Kind regards
Enzo
It’s a bit ugly. Even though you define the custom attribute as environment (all lower case) the actual variable in the notification context is called HOST_ENVIRONMENT (all upper case):
Definition of the host attribute (remember to check the bottom most option!):
Thanks for your answers.
I’ve tried lower case, upper case, a different variable name, different topic, but no luck.
I deleted my previous definition of the custom variable and now the new one does not show in any host variables.
I noticed that you use HOST_variable and when I first looked up to it I got HOSTLABEL_variable. But now neither shows up.
I suppose it is a bug of my cmk version?