11.25 SMTPMail

Use this Knowledge Script to send an SMTP mail message with AppManager event information to a list of one or more mail recipients.

By default, the event information includes the computer name of the monitored computer and the event severity. You can include additional information by enabling the appropriate parameters.

To override the default subject and body for the email message, select Custom Message Options parameters.

This script raises an event if you select the custom message format but neglect to enter any text for the body of the custom message. Under these circumstances, the script continues to run using the standard message format.

If you enter an invalid ending word number, for example, if an event detail message has 10 words in it, and the user specifies word 15, the entire short message or detail message for is returned. For example:

$ShortMsg$[5-15] or $DetailMsg$[5-15]

If the event message had 15 or more words in it, SMTPMail will return a message with words 5 through 15 in the message.

11.25.1 Setting Parameter Values

Set the following parameters as needed:

Parameter

How to Set It

Event Notification

Raise event if SMTP server is not accessible?

Select Yes to raise an event if the SMTP server cannot be reached. The default is Yes.

Event severity -- SMTP server not accessible

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the SMTP server cannot be reached. The default is 35 (magenta event indicator).

Event severity -- Action failure

Set the event severity level, from 1 to 40, to indicate the importance of an event in which the SMTPMail job fails. The default is 5 (red event indicator).

Severity Configuration

Minimum event severity for Action

Specify the minimum severity level, from 1 to 40, for an event that triggers this Action. The default is 1.

Maximum event severity for Action

Specify the maximum severity level, from 1 to 40, for an event that triggers this Action. The default is 40.

Action

List of recipient email addresses

Provide the full email address for each recipient of the message. Use semicolons (;) to separate multiple recipient addresses. For example: chris@abc.com;pat@def.com;jw@abc.com.

NOTE:The following characters are invalid in this parameter:

/ \ [ ] : | = , * ? < >

Sender’s email address

Provide the email address of the person sending the message.

Notes

  • In Microsoft Exchange Server 2007 environments, specify the sender name in SMTP format: <name>@<domain>.

  • The following characters are invalid in this parameter:

    / \ [ ] : | = , * ? < >

SMTP Server

SMTP server name

Provide the host name or IP address of your SMTP server. The default is inet01.

SMTP port

Set the port number for your SMTP server. The default is 25.

Transmit message using Transport Layer Security (TLS)?

Select Yes to transmit the message using the Transport Layer Security.

The default is unselected.

Ping SMTP server before sending mail message?

Select Yes to ping the SMTP server to verify TCP connectivity before attempting to send an email to your listed recipients. The default is Yes.

Message Content

Message format

Select the format you want to use for the message sent by this script:

  • Standard format generates a message based upon the selections you make from the Standard Message Options parameters.

  • Custom format generates a message based upon the subject and message body you supply in the Custom Message Options parameters.

The default is Standard.

Standard Message Options

Include date/timestamp?

Select Yes to include the date/timestamp in the standard message. The default is unselected.

Include JobID?

Select Yes to include the job ID in the standard message. The default is unselected.

Include agent computer name?

Select Yes to include the name of the agent computer that initiated the Action in the standard message. The default is Yes.

Include event severity?

Select Yes to include the severity of the event in the standard message. The default is Yes.

Include Knowledge Script name?

Select Yes to include the name of the Knowledge Script that initiated the Action in the standard message. The default is unselected.

Include AppManager object name?

Select Yes to include the name of the resource object where the event was raised in the standard message. The default is unselected.

Include AppManager event ID?

Select Yes to include the AppManager event ID in the standard message, possible only in cases when the Action is carried out by the management server. The default is unselected.

Include event detail message?

Select Yes to include the event detail message. The default is unselected.

NOTE:In Microsoft Outlook 2003 SP2 environments, the detail message information may be unformatted and presented in one string of text, such as in the following example:

Detail Message: Memory Utilization: Top 10 Consuming Processes ============================================== Process Name: Rtvscan Process ID (PID): 1684 Utilization (KB): 51,528.00   Process Name: NetIQmc Process ID (PID): 3424 Utilization (KB): 23,956.00   Process Name: svchost#4 Process ID (PID): 832 Utilization (KB): 17,784.00   

Custom Message Options

Custom message subject

Provide the text you want to use for the custom message subject line.

NOTE:If you select Custom in the Message Format parameter, yet fail to specify anything in this parameter, the selected Standard Message Options parameters are used.

Custom message body

Provide the text you want to include in your custom message.

NOTE:If you select Custom in the Message Format parameter, yet fail to specify anything in this parameter, the standard message body is used instead.

You can use the keywords listed below to indicate the information you want to include in the body of your custom message. Add a space before and after keywords to ensure that the keywords display properly.

  • $ShortMsg$ (short event message)

  • $DetailMsg$ (detailed event message)

  • $Time$ (date and time of the event)

  • $JobID$ (ID of the job that raised the event)

  • $MachineName$ (name of the computer where the event was raised)

  • $Severity$ (severity of the event)

  • $KSName$ (name of the Knowledge Script that raised the event)

  • $ObjectName$ (name of the AppManager resource object where the event was raised)

  • $EventID$ (event ID)

  • $tab$ inserts four whitespace characters in the message body

  • $lf$ inserts a line feed in the message body

  • $crlf$ inserts a carriage-return line feed in the message body

  • $cr$ inserts a carriage-return in the message body

For $ShortMsg$ and $DetailMsg$ you can use number and wildcard options to indicate specific portions of the text string to include. For example:

  • $DetailMsg$[5] includes the fifth word of the detailed event message

  • $ShortMsg$[1-5] includes the first through fifth words of the short message event

  • $DetailMsg$[*5] includes the first through fifth words of the detailed event message

  • $ShortMsg$[5*] includes the fifth through last words of the short event message

This script treats the following character values as separators between words: carriage return, line feed, carriage return/line feed combination, form feed, horizontal tab, and space. Everything between those character values in a custom message is considered a word.

If you do not enter a keyword, AppManager returns the entire string.

The following are examples of the types of messages you can construct using keywords:

  • Event from $MachineName$: The $ShortMsg$[1-3] has failed. The last command was $DetailMsg$[4*].

  • A severity $Severity$ event has occurred. Call the owner of $MachineName$ immediately.

Attachment Options

List of attachments

Provide a list of attachments, including the full pathnames. Use semicolons (;) to separate multiple attachments. For example: c:\temp\SysAdminContacts.log.

NOTE:If you enter an invalid path name, the attachment would not be found and an event would be raised if the Raise event if attachment(s) not found? parameter is set to Yes.

Raise event if attachment(s) not found?

Select Yes to raise an event if the attachment(s) is not found. The default is Yes.

Send message without attachment(s) if not found?

Select Yes to send a message if the attachment(s) is not found. The default is unselected.