OpsMgr Script Respond to Alert
Good Morning everyone. I am looking for a script to create an event based on an alert. In the event I would like to use the alert Event ID, Event Description, and logging computer. I have written a script that creates an event and used the $Data/EventDisplayNumber$, $Data/EventDescription$, $Data/LoggingComputer$, $Data/EventNumber$ as parameters for the script. It creates the evnt but does not contain the information from the alert. For instance: Event 123 is logged. For the Alert rule I have a response that is a script that creates a 999 event containing the Event ID, Event Description, Logging Computer. Any help that can be offered is greatly appreciated.
January 22nd, 2011 3:35pm

Try $Data/Context/DataItem/EventDisplayNumber$. http://OpsMgr.ru/
Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2011 3:43pm

How are you launching the script?Microsoft Corporation
January 22nd, 2011 3:47pm

I really appreciate your quick response and thank you for your assistance. Maybe im just not doing this right but below is the script that I am using to create an event. Option Explicit Dim oAPI, oArgs Set oAPI = CreateObject("MOM.ScriptAPI") Set oArgs = WScript.Arguments Call oAPI.LogScriptEvent("LogScriptEventArgs.vbs", 102, 2, oArgs(0) & " " & oArgs(1) & " " & oArgs(2)) WScript.Quit -1 Then for the Arguments I have specified both sets $Data/EventDisplayNumber$ , $Data/EventDescription$ , $Data/LoggingComputer$ and $Data/Context/DataItem/EventDisplayNumber$, $Data/Context/DataItem/EventDescription$, $Data/Context/DataItem/LoggingComputer$ for the arguments and neither one produces the proper event. Once again all help is greatly appreciated.
Free Windows Admin Tool Kit Click here and download it now
January 22nd, 2011 4:43pm

I am launching the script as a response to an alert.
January 26th, 2011 1:30am

Hi, Please take a look at this thread http://social.technet.microsoft.com/Forums/en-US/operationsmanagergeneral/thread/4ce08cad-7807-4f46-a7cc-20742e1dc8ff/ Anders Bengtsson | Microsoft PFE | blog at http://www.contoso.se
Free Windows Admin Tool Kit Click here and download it now
May 11th, 2011 2:04pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics