HP Operations Manager for Windows

Sending Messages through Email


This method for sending messages through email relies on the WMI instance class OV_Message that HP Operations Manager for Windows creates whenever a message is received by the management server. A WMI policy monitors the namespace for these instances. When an instance is created that matches criteria that you specify in the policy, an automatic command runs an executable which extracts the message information from WMI, formats it according to your specifications, and then sends it to an email address that you specify in the policy.
Note NOTE:
If message counters are enabled, only one message (the original) is sent by email. The duplicates to the original message are not sent by email. When the original message is acknowledged and a duplicate to the acknowledged message arrives, a new email will be created.

To receive messages through email:

  1. Modify the automatic command
    1. Start the HP Operations Manager for Windows Management Console.
    2. Locate the policy Samples/Send Email/FwdMsgAsEMail
    3. Double-click the policy to open it.
    4. Click the Rules tab and use the Automatic Command link to access the following command:

      cscript.exe "%OvInstallDir%\bin\FwdMsgAsEMail.vbs" -MsgId <$WBEM:TargetInstance.Id> -to "Recipient@RecipientDomain.com" -from "Sender@SenderDomain.com" -mailsrv "fqdn of SMTP server" -name "HP Operations Manager"

      Perform the following changes:

      1. Replace Recipient@RecipientDomain.com with the email address you want to send the email to (for example Joe@mailserver.de). The email client contacts the RecipientDomain server by way of SMTP.
      2. Replace Sender@SenderDomain with the email address you want to use to send the email from.
      3. Replace "fqdn of SMTP server" with the fully qualified domain name of the SMTP server you want to use to send the emails.
  2. Indicate which messages should be sent. You must now modify the rule with conditions that match specific properties of the instance class OV_Message. For example, to forward every message with severity Critical, add a rule that looks like this:

    Property of TargetInstance
    Property name Severity
    Operator == equal
    Select value or property value
    Specific value to compare 32
    If you want to match more than one type of message, copy the rule and modify the conditions. You can also modify the email recipient if different messages should be mailed to different email addresses.

    Caution CAUTION:
    The policy sends a message to the message browser to verify that email was sent. It is important that the match criteria that you define for each rule does not also match this verification message. If it does, then a loop condition will occur.

  3. Save the policy and deploy to the management server.

Reference Information

FwdMsgAsEMail.vbs

This script retrieves important information message and node properties from WMI and calls OvEpMail.exe with the corresponding parameters to send an email.

Usage

FwdMsgAsEMail.vbs -from <Sender@SenderDomain.com name> -name <display name>
-to <Recipient@RecipientDomain.com>
mailsrv <fqdn of SMTP server> -MsgId <Message ID>
-subject <subject text> optional
-from: <Sender@SenderDomain.com> is the senders email address
-name: <display name> is the name that will be displayed as originator
-to: <Recipient@RecipientDomain.com> is the recipients email address
-mailsrv: <fgdn of SMTP server> is the fully qualified domain name (for example, mail.mydomain.com) of the SMTP server to be used for sending the email. address
-MsgId: <Message ID> is an ID that identifies the message. It is usually passed through the HP Operations Manager for Windows variable <$WBEM:TargetInstance.Id>
It is used to retrieve the message data from WMI.
-subject: <subject text> specifies the text within the subject field of the email.

The script FwdMsgAsHtmlEMail is also available. Both scripts share the same parameters, but produce somewhat different output.

FwdMsgAsEMail.vbs takes the message text and passes it to OvEpMail with the option -format convert. This produces an email consisting of the preformatted message text.

FwdMsgAsHtmlEMail takes more properties of the message from WMI and passes them to OvEpMail with the -format HTML. This creates a formatted HTML page.

OvEpMail.exe


OvEpMail.exe is a command line mail client.

Usage

OvEpMail.exe -to <Recipient@RecipientDomain.com>[;<Recipient2@Recipient@Domain.xxx;<...>
-from <Sender@SenderDomain.com name> [-name <display name>]
-mailsrv <fqdn of SMTP server> -format <plain|HTML|convert>
-body <body text> [-subject <subject text>]
-to: <Recipient@RecipientDomain.xxx>[;<Recipient2@Recipient2Domain.xxx>; <...>] is one or more recipient(s) email address. (Entering more than one email address separated by ";" is optional.)
-from: <Sender@SenderDomain.com> is the sender's email address
-mailsrv: <fqdn of SMTP server> is the fully qualified domain name (such as "mail.mydomain.com") of the SMTP server to be used for sending the emails.
-name: <display name> is the name that will be displayed as originator
-format: The format parameter takes the three values plain, HTML or convert

plain:
The body text of the email is a text that consists of ASCII characters.
It will be sent as an email in text format.
HTML:
The body text is an entire HTML page. Every character is an ASCII character.
This page will be sent as an email in HTML format.
convert:
With this option the body text may contain any character.
The text will be sent as a preformatted HTML email.
That means, there will be a replacement of non ASCII characters and HTML special characters. They will be replaced in the HTML style, with