Home » 2007 (Page 12)

Yearly Archives: 2007

Active Directory MP update for Operations Manager RC2

A new version of the Active Directory management pack is available for download at Microsoft Connect webpage. This updated version of the AD MP addresses several issues in the original AD MP that shipped with RC2.  Specifically it fixes:

    • AD Topology Discovery
    • Discovery of DCs with non-US locales
    • Discovery of Windows Server 2000 DCs
    • Fixed problem: Defect: AD MP for Windows Server 2000/2003 – local discovery of the Domain Controller fails if targeted DC is using a non-US date/time/number format 
    • Fixed problem: Defect: AD MP for Windows Server 2000 (all locales – under certain conditions)  

Check two or more performance counters

I have done a script that will check two performance counters and generate an alert if both are over threshold values. It simple to add more performance counters and change the threshold values. I have test it on Windows Server 2003 and Window XP 32bit. Its fairly basic, but it will show you a way to generate an alert based on two or more performance counters.

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\\” & strComputer & “\root\cimv2”)
set objRefresher = CreateObject(“WbemScripting.SWbemRefresher”)
Set colItems = objRefresher.AddEnum _
(objWMIService, “Win32_PerfFormattedData_PerfOS_System”).objectSet
objRefresher.Refresh
For i = 1 to 2
For Each objItem in colItems

strProc = objItem.Processes
strCPUQL = objItem.ProcessorQueueLength

If strProc > 40 AND strCPUQL > 0 Then
Const EVENT_WARNING = 2
Set objShell = CreateObject(“Wscript.Shell”)
objShell.LogEvent 2, “Number of processer: ” & strProc & “. Processor Queue Lenght: ” & strCPUQL
End If
objRefresher.Refresh
Next
Next

1. Create a new script and paste the script source
2. Create a new event rule to run the script every X minute as respond
3. Create a new event rule to collect event ID 2 and event type of Warning
4. Commit configuration change

Monitor if a share is accessible

This script will check if a file in a share is accessible, if not, it will generate a local event.

strFile = "\\ntlcs\share\file_check.txt"
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strFile) Then

Else
   Const EVENT_WARNING = 2
    Set objShell = CreateObject("Wscript.Shell")
    objShell.LogEvent 2, strFile & " is not accessible."
End If

  1. Create a new script and paste the script
  2. Create a new event rule to run the script every X minute as respond
  3. Create a new event rule to collect event ID 2 and event type of Warning
  4. Commit configuration change

MOM Email Service

David Wallis has made a cool application, MOM Email Service, that make it possible to acknowledge and resolve alerts by e-mail. You can read more about the application here. You can read more about David Wallis at his webpage. Great work !

Monitor file and directory size

This script will monitor file and directory size. It will generate performance data back to the management server. You can view this information under performance view in Operators Console or/and in reports. This first example will monitor the size C:\pagefile.sys
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile("c:\pagefile.sys")
CreatePerfData "File","File Size",objFile.Path,objFile.Size
Sub CreatePerfData(strObjectName,strCounterName,strInstanceName,numValue)
    Set objPerfData = ScriptContext.CreatePerfData
    objPerfData.ObjectName = strObjectName
    objPerfData.CounterName =strCounterName
    objPerfData.InstanceName = strInstanceName
    objPerfData.Value = numValue
    ScriptContext.Submit objPerfData
End Sub

This example will monitor the size of all subfolders under C:\ 

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\")
Set colSubfolders = objFolder.Subfolders
For Each objSubfolder in colSubfolders
CreatePerfData "File","File Size",objSubfolder.Path,objSubfolder.Size
Next
Sub CreatePerfData(strObjectName,strCounterName,strInstanceName,numValue)
                    Set objPerfData = ScriptContext.CreatePerfData
                    objPerfData.ObjectName = strObjectName
                    objPerfData.CounterName =strCounterName
                    objPerfData.InstanceName = strInstanceName
                    objPerfData.Value = numValue
                    ScriptContext.Submit objPerfData
End Sub

  1. Insert the script as a new script in Administrator Console
  2. Create a event rule that run the script every X minute
  3. Commit configuration change and wait until the script has run
  4. Open Operator Console, click performance, click you server and choose your new FILE performance objects, click draw graph

There is a guide about how to create performance data reports at momresources.org

Monitor recovery mode

This script will check recovery mode of a MS SQL database. Its pretty simple to modify to check other databases or all databases. This example will check if the Onepoint database is running with SIMPLE recovery mode. If it does, a local event will be generated. You can then create a event rule to collect that event and generate an alert in MOM.

set cn = Nothing
set rs = nothing
strSQLServer = "localhost"
Set cn = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
cn.Open "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=master;Data Source=" & strSQLServer & ""
strSQLQuery = "select name, databasepropertyex(name, 'recovery') as RECOVERY from sysdatabases WHERE NAME = 'OnePoint'"

Set rs = cn.execute(strSQLQuery)
strDBName = rs("Name")
strMode = rs("Recovery")

If strMode = "SIMPLE" then
 Const EVENT_WARNING = 2
 Set objShell = CreateObject("Wscript.Shell")
 objShell.LogEvent 2, "The " & strDBName & " database is running in simple recovery mode"
End If

  1. Create a new script and paste this source
  2. Create a rule that run the script every X minute
  3. Create a rule that collects and generate alerts on event ID 2 from WSH in the application log.

Updated OpsMgr 2007 Documentation and Active Directory MP

New resources are available for your Operations Manager 2007 RC2 testing and feedback 
   

Active Directory management pack for Operations Manager 2007, the following problems was fixed: 
  • Defect: AD MP for Windows Server 2000/2003 – local discovery of the Domain Controller fails if targeted DC is using a non-US date/time/number format
  • Defect: AD MP for Windows Server 2000 (all locales – under certain conditions)

Documentation

  • How to cluster the root management server – The following procedures show how to install Operations Manager 2007 Root Management Servers on a Windows cluster
  • Operations Manager 2007 Quick Start Guide – The Quick Start Guide is designed to help you quickly deploy Operations Manager 2007 for evaluation purposes in a test environment.

http://connect.microsoft.com/systemcenter 

 

 

 

Microsoft System Center “Service Desk”

I run into the Microsoft System Center “Service Desk” timeframe on a wepage

  • Beta1: December 2006 (TAP is running)
  • Beta 2: end of April 2007
  • RC: beginning of July 2007
  • RTM: December 2007

There will be a public beta around March 2007 (according to the rumor)  

There are a couple of screenshots at this and this page. You can find more information about “Automating IT Service Management with System Center” here

FAQ

I have notice a couple of common questions in newsgroups and forums this week.

Rule that will alert you if process X use more that Y % Processor Time
In this example I will montor if iexplorer (Internet Explorer) takes more that 1 % processor time. Maybe not a very common scenario, but it will work to show you how to setup this for other processes and thresholds.

First we need to create a new provider to collect the performance counter, and then an alert that will compare performance data and generates an alert. 

  1. Create a new provider in MOM 2005 Administrator Console
    Computer: or
    Object: Process (use “advanced” to enable this dropdown menu)
    Counter %Processor Time
    Instance: iexplorer (you might need to start that process before it shows up in the list)
  2. Create a new performance rule to compare performance data (threshold
    Provider:
    Schedule: Always process data
    Criteria: Leave default values
    Threshold: “Match when the threshold meet the following condition:” “greater than the following value: 1”
    Alert: Generate alert
    Alert suppression: Leave default settings
    Response: None
    Knowledge Base: Optional
    General: Input a name and verify that the rule is enabled 

That should do it. Note that it can take a couple of minutes before the new rule is active.

 

How do I see all members of a computer group?

  1. Start Operator Console
  2. Click public views
  3. Click computer groups
  4. Right-click a computer group and choose view -> computers

 

 

Â