Microsoft Operations Manager |
The CreateAlertmethod generates a new Alertobject.
[VBScript] ScriptContext.CreateAlert()
None
Object (Alert)
The Alertobject returned by this method is initially empty. After creating the new Alertobject, assign a value to it using the ScriptContext.Alertproperty. The Alertobject can then be sent to the MOM data stream using the ScriptContext.Submitmethod.
The following example shows how to generate a new Alertobject.
[VBScript]
Function CreateNewAlert()
Dim objCreatedAlert
Dim objAlert
Set objCreatedAlert = ScriptContext.CreateAlert()
If (ScriptContext.IsAlert()) Then
Set objAlert = ScriptContext.Alert
objCreatedAlert.Name = objAlert.Name
objCreatedAlert.AlertLevel = 50
objCreatedAlert.Owner = "[unassigned]"
objCreatedAlert.ResolutionState = 0 ' New
Else
Set objCreatedAlert = Nothing
End If
Set objAlert = Nothing
Set CreateNewAlert = objCreatedAlert
End Function
Windows NT/2000: Requires Windows 2000 or later
Version: Requires MOM 1.0 SP1
ScriptContext Object, ScriptContext.Alert Property, ScriptContext.Submit Method, Alert Object
Did you find this information useful? Please send your suggestions and comments about the documentation to momsdk@microsoft.com.