Free Vars, macros, and inheritence
Posted: Fri May 14, 2021 8:43 am
Nagios XI 5.8.1
RHEL 7.7
Good morning! If I have a service template that is applied to a service, and the sevice template maps two free variables as such:
_kb $SERVICENOTESURL$
_alert_number $SERVICENOTIFICATIONNUMBER$
In the command I have appended --kbarticle="$_SERVICEKB$" --alertnumber="$_SERVICEALERT_NUMBER$"
The notes url field is populated within the specific service check. Are those macros able to be parsed via the free variables, and pulled in through the template to pick up the specific URL in the service and the notification number when sending an email alert? I was trying to use the free vars in the service template so I could simply populate the notes url field in the service check itself and have that URL end up in the emailed alert.
Currently with this setup, the alert is still coming across with the %kb% and %alertnumber% free vars in the emailed alert, like so:
Additional Info: WARNING - md5sum is not in list. Adding for you now.
Notifications sent: %alertnumber%
KB Article: %kbarticle%
Am I missing something, or is there a better way to handle this?
RHEL 7.7
Good morning! If I have a service template that is applied to a service, and the sevice template maps two free variables as such:
_kb $SERVICENOTESURL$
_alert_number $SERVICENOTIFICATIONNUMBER$
In the command I have appended --kbarticle="$_SERVICEKB$" --alertnumber="$_SERVICEALERT_NUMBER$"
The notes url field is populated within the specific service check. Are those macros able to be parsed via the free variables, and pulled in through the template to pick up the specific URL in the service and the notification number when sending an email alert? I was trying to use the free vars in the service template so I could simply populate the notes url field in the service check itself and have that URL end up in the emailed alert.
Currently with this setup, the alert is still coming across with the %kb% and %alertnumber% free vars in the emailed alert, like so:
Additional Info: WARNING - md5sum is not in list. Adding for you now.
Notifications sent: %alertnumber%
KB Article: %kbarticle%
Am I missing something, or is there a better way to handle this?