How do you modify
mail-filter.asl so that you only receive an email if an event name matches certain text?
How can I configure the Smarts SAM
Mail Notifier so that I only receive email notifications when an event matches specific text?
To configure the Mail Notifier to only generate emails based on specific text, do the following:
- Open the mail-filter.asl for editing using sm_edit as follows:
<BASDIR>/smarts/bin/sm_edit rules/notifier/mail/mail-filter.asl
- Use the OMIT_NON_MATCHING_EVENTS ASL function to match the text you want to generate the notification email. The following ASL code example shows how to use this function so that an email will only be sent if InstanceDisplayName contains the characters "MIS".
/*
* Filter out events.
*/
START() {
OMIT_NON_MATCHING_EVENTS
}
OMIT_NON_MATCHING_EVENTS() filter {
!glob( "*MIS*", currentEvent->icInstanceDisplayName )
} do {
currentEvent->filterMe = TRUE;
}
- Restart the Mail Notifier to implement the change in the live system.