Huntland Services Ltd

Tel: +44 (0)1392-490518
Fax: +44 (0)1392-428003
Enquiries@huntland.co.uk

Manually Send Alerts or Service Level Exceptions as Email

 

Back

Download The Script

 

 Any node item in the detail pane of the Monitor node in the Mom Admin Console is potentially capable of launching a context sensitive task.  This means you can expand the Alerts for a given system and extract any of several variables that can be fed as parameters into the script.  All you have to do is right click, chose the Custom Task and click execute.  A previous example of this process was published here at http://www.huntland.co.uk/Downloads/MOM/CreateACustomTask.html

 

By creating a custom node based on Alerts you can use this script to send an email about Alerts or Service Level Agreement exceptions.  The latter is essentially an Alert that has time expired.  There is currently no way for Mom Sp1 natively to send emails about SLA’s. (see Q297810 )

This is how to set it up.

  • Download the script and place it in your chosen folder (e.g. C:\MomScripts\SendAlertEmail.vbs) on a system that has the Mom console installed.
  • Configure your system to use Outlook and test it sends/receives email correctly
  • In the Mom Admin Console, with the focus on the Monitor node, Right Click, select New and Custom Task.
  • The Custom Tasks dialog opens
  • In the Task Available For drop down list, select Alert Items
  • Click Add
  • Give your task a name and description. e.g. Send Email
  • Enter the following Command: (The download has a text file with this command which you can just copy and paste)
    wscript.exe "C:\MomScripts\SendAlertEmail.vbs" "$Severity$" "$Time$" "$Computer$" "$Resolution State$" "$Owner$" "$Source$" "$Name$" "$Domain$" "$Repeat Count$" "$GUID$" "$Description$"
  • Click OK, OK to close the dialog.
  • In the Mom Admin Console you can now select any node which displays Alert data. Including SLA’s.
  • Select Custom Tasks and then pick Send Email.

Limitations

1.        Not every SLA exception has an owner and not all owner names are valid email addresses.  For simplicity’s sake no attempt is made to look this up and verify it.  When the script runs you will be prompted to fill in the email address but the owner name will be there by default.

2.      The description field of an alert can (and usually does) contain at least one carriage return in the string.  This means the parameter passed to the script will truncate at that point.  This means that the description sent in the email – although probably containing enough information – may not be the whole text.  The recipient would have to check the original alert if it was important.

3.      The script relies on Outlook installed and working locally. 


Please accept this script as is.  Any feedback will be gratefully received at Debug@Huntland.co.uk