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?
Free Vars, macros, and inheritence
Free Vars, macros, and inheritence
--
Griffin Wakem
Griffin Wakem
Re: Free Vars, macros, and inheritence
It looks like this may have been missed Friday, any ideas?
--
Griffin Wakem
Griffin Wakem
Re: Free Vars, macros, and inheritence
You don't need to use a template in this case. Simply append the following to the end of your notification command:
Save and apply configuration. The notesurl will be "picked up" from each service if you have one added.
Also, make sure you have the following in the "Service Alert Message" field (Account > Notification Options > Notification Messages):
Click on "Update Settings".
You should see something like this in your emails (example):
Code: Select all
--alertnumber="$SERVICENOTIFICATIONNUMBER$" --notesurl="$SERVICENOTESURL$"Also, make sure you have the following in the "Service Alert Message" field (Account > Notification Options > Notification Messages):
Code: Select all
Notifications sent: %alertnumber%
KB Article: %notesurl%You should see something like this in your emails (example):
Let us know if this helped.Notifications sent: 0
KB Article: https://support.nagios.com/kb/
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Free Vars, macros, and inheritence
This did it. Thanks for your assistance! Lock away.
--
Griffin Wakem
Griffin Wakem
Re: Free Vars, macros, and inheritence
I am glad I could help! 
Be sure to check out our Knowledgebase for helpful articles and solutions!