For an Email Notifier Adapter, the mail-custom.asl script contains the details of the script. Modifying the mail-custom.asl script allows you to specify which combination of notification attributes will be included in the email.
To modify the mail-custom.asl script:
-
Using sm_edit, open the mail-custom.asl script. For example:
t BASEDIR/smarts/bin>sm_edit rules/notifier/mail/mail-custom.asl s
-
Add the notification attributes for the subject and body of the email message you want generated for the notification.
For example, if you want to add the timestamp attribute to the subject and the event type attribute to the body of the email message, edit mail-custom.asl as follows (the bold attributes indicate the modifications):
START() { local subject = ""; local body = ""; } filter { /* * Only send here if sentByCustom is TRUE. */ (currentEvent->sentByCustom) } do { subject = currentEvent->icTimestamp." ". currentEvent->icDisplayType." ". currentEvent->icInstanceDisplayName." ". currentEvent->icEventDisplayName; body = (" InCharge Server " . serverName . ":\n " . currentEvent->icDisplayType . " " . currentEvent->icClassDisplayName . " " . currentEvent->icInstanceDisplayName . " ". currentEvent->icEventType . " ". currentEvent->icEventDisplayName . " (" . string(currentEvent->icCertainty) . "%):\n " . currentEvent->icEventDescription . "\n"); mailer->sendmail(sender, recipients, subject, body) ? LOG,STOP; }
-
Save the modified script. The sm_edit utility automatically saves the script to the BASEDIR/smarts/local/rules/notifier/mail directory.