Smarts SAM: How do you modify mail-filter.asl so that you only receive an email if an event name matches certain text?
search cancel

Smarts SAM: How do you modify mail-filter.asl so that you only receive an email if an event name matches certain text?

book

Article ID: 304230

calendar_today

Updated On:

Products

VMware

Environment

VMware Smart Assurance - SMARTS

Resolution

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:

  1. Open the mail-filter.asl for editing using sm_edit as follows:

    <BASDIR>/smarts/bin/sm_edit rules/notifier/mail/mail-filter.asl

     
  2. 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;
    }

  3. Restart the Mail Notifier to implement the change in the live system.