Loading

×Sorry to interrupt
This page has an error. You might just need to refresh it.
[NoErrorObjectAvailable] Uncaught ReferenceError: addCTracking is not defined
Failing descriptor: {markup://c:KM_ArticleThemeLayout}

Refresh

Cookie Preference Center

General Information on cookies

When you visit our website, we use cookies to ensure that we give you the best experience. This information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies by clicking on the different category headings to find out more and change your settings. However, blocking some types of cookies may impact your experience on the site and the services we are able to offer. Further information can be found in our

Cookie Policy.

Strictly Necessary

Strictly Necessary

Always Active

Strictly Necessary

Strictly necessary cookies are always enabled since they are essential for our website to function. They enable core functionality such as security, network management, and website accessibility. You can set your browser to block or alert you about these cookies, but this may affect how the website functions. For more information please visit www.aboutcookies.org or www.allaboutcookies.org.

Cookie Details‎

Performance

Performance

Performance

Performance cookies are used to analyze the user experience to improve our website by collecting and reporting information on how you use it. They allow us to know which pages are the most and least popular, see how visitors move around the site, optimize our website and make it easier to navigate.

Cookie Details‎

Please confirm your settings by refreshing the page.

Functional

Functional

Functional

Functional cookies help us keep track of your past browsing choices so we can improve usability and customize your experience. These cookies enable the website to remember your preferred settings, language preferences, location and other customizable elements such as font or text size. If you do not allow these cookies, then some or all of these services may not function properly.

Cookie Details‎

Advertising

Advertising

Advertising

Advertising cookies are used to send you relevant advertising and promotional information. They may be set through our site by third parties to build a profile of your interests and show you relevant advertisements on other sites. These cookies do not directly store personal information, but their function is based on uniquely identifying your browser and internet device.

Cookie Details‎

Advertising Cookies

Consent Leg.Interest

Select All Vendors

Select All Vendors

Select All Hosts

Select All

Clear Filters

Information storage and access

Apply

Confirm My Choices Reject All Allow All

My Subscriptions

Loading

Knowledge Base

Customizing subject and body of the emails sent out by EMC Smarts Mail Notification Adapter (355304)

Last Updated: 3/22/2024Categories: TroubleshootingTotal Views: 4199Language:
English

Subscribe to get an email
newsletter with new updates

Please provide article feedback:

Symptoms

Customizing subject and body of the emails sent out by EMC Smarts Mail Notification Adapter.

Add or change fields used by "sm_notify mail" to meet custom requirements.

Resolution

Customization of notification adapters is covered in great detail by sa_notification_adapter.pdf located in <BASEDIR>/SAM/smarts/doc/pdf directory.  Below is a summary and an example of customizing sm_notify mail. In order to customize the format of emails sent out by "sm_notiy mail" adapter, 2 files need to be modified.  Use sm_edit to modify these files so modifications are saved under local directory structure.
<BASEDIR>/SAM/smarts/local/rules/notifier/mail/mail-filter.asl and <BASEDIR>/SAM/smarts/local/rules/notifier/mail/mail-custom.asl

Modify OMIT_CLEAR_EVENTS function in mail_filter.asl file. The default function allows the mail notifier to skip "CLEAR" notifications and not send out an email once a notification has cleared. The modified function below does the same but is also allows execution of custom code that has changes or customizations to the format of the emails sent out by the notifier. Lines 51-55 contains the code the set currentEvent->sentByCustom to TRUE. By setting currentEvent->sentByCustom, we are telling the notifier to read in customizations in mail-custom.asl.

OMIT_CLEAR_EVENTS()
42  do {
43      if (currentEvent->icType == "CLEAR" ""
44          currentEvent->icType == "NL_CLEAR")
45      {
46          // Discard Clear events
47          currentEvent->filterMe = TRUE;
48          print(time()."currentEvent->filterMe is ".currentEvent->filterMe);
49      } else if (currentEvent->icType == "NOTIFY" ""
50                 currentEvent->icType == "NL_NOTIFY")
51      {
52          // Customize and forward Notify events
53          currentEvent->sentByCustom = TRUE;
54          print(time()."currentEvent->sentByCustom is ".currentEvent->sent ByCustom);
55      }
56  }

After modifying mail-filter.asl, changes need to be made to mail-custom.asl. Line 53 means changes to the "subject" line of the email specified below will be used only if currentEvent->sentByCustom is set to TRUE. This is done in mail-filter.asl above. By default, subject of an email sent out by email notifier contains "Instance Name" and event name. In the code below, we are also adding currentEvent->icDisplayType, currentEvent->icFirstNotifiedAt. Note we also call time() function on the FirstNotifiedAt value as it is notified in EPOC time by default.

53      (currentEvent->sentByCustom)
54  } do {
55
56      /*
57       * This is how the adapter constructs the default message.
58       * Edit to suit your tastes.
59       */
60
61      subject = currentEvent->icDisplayType." ".
62                time(currentEvent->icFirstNotifiedAt)." ".
63                currentEvent->icInstanceDisplayName." ".

Lines 51-77 add additional fields to the body of the email in the same manner it was done for the subject.

51       * Only send here if sentByCustom is TRUE.
52       */
53      (currentEvent->sentByCustom)
54  } do {
55
56      /*
57       * This is how the adapter constructs the default message.
58       * Edit to suit your tastes.
59       */
60      subject = currentEvent->icDisplayType." ".
61                time(currentEvent->icFirstNotifiedAt)." ".
62                currentEvent->icInstanceDisplayName." ".
63                currentEvent->icEventDisplayName;
64      body = ("InCharge Server: " . serverName . "\n  ".
65              "Display Type: ".currentEvent->icDisplayType . " \n" .
66              "Display Name: ".currentEvent->icClassDisplayName . " \n" .
67              "Instance Display Name: ".currentEvent->icInstanceDisplayName . "\n ".
68              "First Notified: ".time(currentEvent->icFirstNotifiedAt) . "\n ".
69              "Last Notified: ".time(currentEvent->icLastNotifiedAt) . "\n
". 70              "Last Changed: ".time(currentEvent->icLastChangedAt) . "\n ".
71              "Count: ".currentEvent->icOccurrenceCount . "\n ".
72              "Description: ".currentEvent->icEventDescription . "\n ".
73              "Event: ".currentEvent->icEvent . "\n ".
74              "Display Name: ".currentEvent->icEventDisplayName ."\n".
75              ".(" . string(currentEvent->icCertainty) . "%)\n  " .
76              "Description: ".currentEvent->icEventDescription . "\n");
77
78      mailer->sendmail(sender, recipients, subject, body) ? LOG, STOP;
79  }

Detectable by VMware SkylineTM

Actions

Copy

link to clipboard
copied!

Print

Language:
English

Attachments

Additional Resources

No results for undefined

Ask The Community

Get answers quickly from VMware experts in the community

Post Subject

CONTINUE IN COMMUNITIES

Related Products:

Related Versions:

VMware Smart Assurance - SMARTS

Take Our Survey

Support Assistant