Hello,
I was wondering if anyone has tried out dynamic template definitions that use the velocity templating framework?
Currently we send out SNMP and SMTP alerts. However we would like
to tailor some of the alerts based on which rule triggered. If I understand the documentation correctly I should be able to use dynamic templates for this.
I.e. SNMP Alerts in some cases should be something like
${Rule.Name}
${Rule.DateTime}
${Rule.Desciption}
${Rule.Rule.URL}
SMTP Alerts will mostly be as they are out of the box
except for the ${Data} and / or ${Diagnosis.Attributes} field which
for some of the rules contain in our case > 200 rows.
Now using the velocity engine one can do something like
#foreach ($event in $context.getEvents().get($mapName))
#if ${Data.size() >= 25)
Truncated the list
#else
Associated Text:
#foreach ($dim in $Data)
$Data
.
.
.And so on
Am I going in the correct direction here?
My main struggle is to find a “neat” way for me to trigger the correct template variation. Sometimes we do want the big list, but some users
only want to know “What failed, when, description stating corrective action” others want the whole deal.
So anyone done anything similar?
Regards
Thor I.