Home » Posts tagged 'Ops Mgr'

Tag Archives: Ops Mgr

Microsoft.MOM.UI.Console.exe /viewname

I have seen a  number of questions about open the Ops Mgr console with a definite view. If you want to do that you can run the Microsoft.MOM.UI.Console.exe command with the /viewname switch. To get the viewname you can follow some tips in this post or you can look in the management pack XML code.

If you for example export and look in the Microsoft.Windows.Server.Library MP you will see a line starting with <View ID=”Microsoft.Windows.Server.Computer.AlertsView”. To start the console with that view run:

Microsoft.MOM.UI.Console.exe /viewname:Microsoft.Windows.Server.Computer.AlertsView

Query a database with a monitor

I have seen a number of questions about how to run queries against a database and verify the answer. One way is to run a script inside a monitor. In this blog I wrote how to setup a script in a two state monitor. The script in this post will count number of  fields, if there are more then five, status of the monitor will be changed. Note that counting starts at 0 with fields collection.

 Const adOpenStatic = 3
Const adLockOptimistic = 3

Set oAPI = CreateObject(“MOM.ScriptAPI”)
Set oBag = oAPI.CreatePropertyBag()

Set objConnection = CreateObject(“ADODB.Connection”)
Set objRecordSet = CreateObject(“ADODB.Recordset”)

objConnection.Open _
“Provider=SQLOLEDB;Data Source=R2B1;” & _
“Trusted_Connection=Yes;Initial Catalog=ContosoConfiguration;” & _
“User ID=CORP\Administrator;Password=;”

objRecordSet.Open “SELECT * FROM roles”, _
objConnection, adOpenStatic, adLockOptimistic

varNo = objRecordSet.Record.Count

If varNO > 5 Then
Call oBag.AddValue(“SQL_Status”,”Error”)
Else
Call oBag.AddValue(“SQL_Status”,”Ok”)
End If

Call oAPI.Return(oBag)

Alert Level and Alert Severity

In MOM 2005 we had seven (10,20,30,40,50,60,70) alert severities. In Ops Mgr 2007 we only have three, critical, information and warning. If you convert a management pack or download a converted management pack you can see in the XML code that for example a rule is genering an alert with AlertLevel 50. If you want to create new views and notification subscriptions for that alert you need to know how alert level is translated to alert severity in Ops Mgr 2007. I did a test with a rule from a converted Biz Talk management pack. I trigged the same rule, but between each test I changed alert level.

Alert Level 70  Critical Alert Severity
Alert Level 60  Critical Alert Severity
Alert Level 50  Critical Alert Severity
Alert Level 40  Critical Alert Severity

Alert Level 30  Warning Alert Severity

Alert Level 20  Information Alert Severity
Alert Level 10  Information Alert Severity

All alert had low priority.