ConfigMgr 2007 Monitor Site System Summarizer

SMSv4_Monitor_Site_System_Summarizer (WriteActionModuleType)

Monitors the SMS Site System Summarizer table in the SMS SQL database for specific status conditions and raises the appropriate events

Element properties:

TypeWriteActionModuleType
IsolationAny
AccessibilityInternal
RunAsDefault
InputTypeSystem.BaseData
Comment{62CAC8EE-9013-482D-91BC-D61FC7AF1CB4}

Member Modules:

ID Module Type TypeId RunAs 
RunScriptAction WriteAction System.Mom.BackwardCompatibility.ScriptResponse Default

Source Code:

<WriteActionModuleType ID="SMSv4_Monitor_Site_System_Summarizer" Accessibility="Internal" Comment="{62CAC8EE-9013-482D-91BC-D61FC7AF1CB4}">
<Configuration>
<IncludeSchemaTypes>
<SchemaType>MomBackwardCompatibility!System.Mom.BackwardCompatibility.AlertGenerationSchema</SchemaType>
</IncludeSchemaTypes>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AlertGeneration" type="AlertGenerationType"/>
<xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InvokerType" type="xsd:integer"/>
</Configuration>
<ModuleImplementation>
<Composite>
<MemberModules>
<WriteAction ID="RunScriptAction" TypeID="MomBackwardCompatibility!System.Mom.BackwardCompatibility.ScriptResponse">
<AlertGeneration>$Config/AlertGeneration$</AlertGeneration>
<InvokerType>$Config/InvokerType$</InvokerType>
<Body><Script>
'*******************************************************************************
' Script Name - ConfigMgr 2007 Monitor Site System Summarizer
'
' Purpose - Monitor specific SMS Site System Summarizer status on SMSv4
' Site Systems and raise appropriate events. SMS 2.0 Site Systems
' are ignored.
'
' The following additional events can be raised:
'
' 1100 - An event used only for debugging or tracing.
' 1101 - Script executed successfully.
' 1102 - An error occurred in executing this script.
' 1105 - Accessed denied due to connection failure or permissions.
' 1106 - SMS Site System is possibly down.
' 1107 - SMS Site System has less than 5% free physical disk space
' 1108 - SMS SQL database has less than 5% free data file space and no autogrow
' 1109 - SMS SQL database has less than 5% free log file space and no autogrow
'
' Assumptions - This script will runs on a system with the SMS WMI Provider
' installed. The system can therefore be either an SMS Primary
' Site Server or Remote Provider.
'
' This script does not support agentless mode and will silently
' terminate.
'
' The agent will be enabled for proxying for other computers.
'
' Parameters - None
'
' Change Hist - Date Version Description
' -------- --------------- -----------
' 08/27/03 02.50.0058.0000 Added Change History.
' 03/17/04 02.50.0169.0000 Added check for agentless mode.
' 05/17/04 05.0.2700.0000 Added event proxying.
' 04/23/05 05.0.2754.0000 Updated for SMSv4.
' 08/18/07 6.0.5000.2 Added event tracing support.
'
' (c) Copyright 2007, Microsoft Corp., All Rights Reserved
'*******************************************************************************

Option Explicit


'Event Severity Constants
'========================

Const EVENT_TYPE_SUCCESS = 0
Const EVENT_TYPE_ERROR = 1
Const EVENT_TYPE_WARNING = 2
Const EVENT_TYPE_INFORMATION = 4

Const EVENTLOG_AUDIT_SUCCESS = 8
Const EVENTLOG_AUDIT_FAILURE = 16


'Event Number Constants
'======================

Const EVENT_ID_NOTANEVENT = 1100
Const EVENT_ID_SCRIPTSUCCESS = 1101
Const EVENT_ID_SCRIPTERROR = 1102
Const EVENT_ID_ACCESSDENIED = 1105

Const EVENT_ID_SITE_SYSTEM_DOWN = 1106 'SMS Site System is possibly down.
Const EVENT_ID_SITE_SYSTEM_FREE_DISK_SPACE = 1107 'SMS Site System has less than 5% free physical disk space
Const EVENT_ID_SITE_SYSTEM_FREE_SQL_DATA_SPACE = 1108 'SMS SQL database has less than 5% free data file space and no autogrow
Const EVENT_ID_SITE_SYSTEM_FREE_SQL_LOG_SPACE = 1109 'SMS SQL database has less than 5% free log file space and no autogrow


'Debug level constants
'=====================

Const DBG_TRACE = 1
Const DBG_WARNING = 2
Const DBG_ERROR = 3
Const DBG_NONE = 4


'SMS Site System Summarizer: PercentFree (SQL database) Constants
'================================================================

Const DB_UNKNOWN_SIZE = -1
Const DB_AUTO_GROW = -2


'SMS Site System Summarizer: StatusLevels Constants
'==================================================

Const STATUS_GREEN = 0
Const STATUS_YELLOW = 1
Const STATUS_RED = 2


'SMS Site System Summarizer: ObjectType Constants
'================================================

Const NALTYPE_NAL_PATH = 0
Const NALTYPE_SQL_DATABASE = 1
Const NALTYPE_SQL_LOG = 2


'WBEM Flag Constants
'===================

Const wbemFlagReturnImmediately = &amp;H10
Const wbemFlagForwardOnly = &amp;H20


'Other constants
'===============

Const SCRIPT_NAME = "ConfigMgr 2007 Monitor Site System Summarizer"


' Global variables
'=================



Sub Main()

Dim bEventTracing


On Error Resume Next

LogMessage DBG_TRACE, ScriptContext.Name &amp; " script starting at local time: " &amp; CStr(Time)

'Check if event tracing is configured. If it is, raise a start event.
'=====================================================================

bEventTracing = IsEventTracingEnabled()

If (bEventTracing = True) Then
LogEvent EVENT_ID_NOTANEVENT, EVENT_TYPE_INFORMATION, "started at local time: " &amp; CStr(Time)
End If

'This script does not support agentless monitoring.
'==================================================

If ScriptContext.IsTargetAgentless Then
Exit Sub
End If

'Check the Site System Summarizer table in the SMS SQL database for
'this machine's site.
'==============================================================

CheckSiteSystemSummarizer

If 0 &lt;&gt; Err.number Then
ScriptError "check Site System Summarizer table in the SMS SQL database." &amp; GetErrorString(Err)
End If

If (bEventTracing = True) Then
LogEvent EVENT_ID_SCRIPTSUCCESS, EVENT_TYPE_INFORMATION, "completed at local time: " &amp; CStr(Time)
End If

LogMessage DBG_TRACE, ScriptContext.Name &amp; " script completed at local time: " &amp; CStr(Time)

End Sub


'******************************************************************************
' Name: CheckSiteSystemSummarizer
'
' Purpose: Check the Site System Summarizer table in the SMS SQL database
' for this machine's site.
'
' Parameters: None
'
' Returns: Nothing
'
Sub CheckSiteSystemSummarizer()

Dim oWbemService
Dim oWbemContext
Dim oInstance
Dim oInstanceSet

Dim strQuery


On Error Resume Next


'Connect to the SMS site namespace.
'==================================

Set oWbemService = GetConnectionToSite()

If Err Then
Exit Sub
End If

'Query for site systems with monitored conditions.
'=================================================

strQuery = GetSMSSSiteSystemSummarizerQuery()

Set oWbemContext = CreateObject("WbemScripting.SWbemNamedValueSet")

oWbemContext.Add "NOLOCK", True

Set oInstanceSet = oWbemService.ExecQuery(strQuery,, _
wbemFlagReturnImmediately + wbemFlagForwardOnly, _
oWbemContext)
If Not IsEmpty(oInstanceSet) Then

For Each oInstance In oInstanceSet

If Not IsEmpty(oInstance) Then

CreateEvents oInstance

End If

Next

Set oInstanceSet = Nothing

End If

'Cleanup
'=======

Set oWbemContext = Nothing
Set oWbemService = Nothing

End Sub

'******************************************************************************
' Name: GetConnectionToSite
'
' Purpose: Gets the Wbem Services object for the local provider's site.
'
' Parameters: None
'
' Returns: Object, the object to return or nothing
'
Function GetConnectionToSite()


Dim oWbemService
Dim oWbemLocator

Dim strMachine, strSiteCode

Dim strQuery


On Error Resume Next

Err.Clear


'Get the SMS Provider information for the provider that is installed
'on this machine.
'===================================================================

GetLocalSMSProviderInfo strMachine, strSiteCode

If Err Then
Set GetConnectionToSite = Nothing
Exit Function
End If

'Connect to the site's SMS namespace through the locally installed
'provider. This will simplify the security model since the MOM Agent
'running under Local System will always be able to access this
'provider. The provider will then know how to connect to the
'appropriate SMS database.
'====================================================================

Set oWbemLocator = CreateObject("WbemScripting.SWbemLocator")

If Err Then
Set GetConnectionToSite = Nothing
Exit Function
End If

Set oWbemService = oWbemLocator.ConnectServer(strMachine, "root\sms\site_" &amp; strSiteCode)

If Err Then
Set GetConnectionToSite = Nothing
Exit Function
End If

Set GetConnectionToSite = oWbemService

'Cleanup
'=======

Set oWbemLocator = Nothing
Set oWbemService = Nothing

End Function

'******************************************************************************
' Name: GetLocalSMSProviderInfo
'
' Purpose: Gets the SMS Provider information for the local provider. If
' the current machine is an SMS Site Server, this information
' will for this machine's SMS site. If the current machine is
' a Remote Provider and SQL Server that is shared, it will not be.
'
' Parameters: strMachine The machine that the provider is installed on,
' the current machine.
' strSiteCode The SMS site that the provider supports.
'
' Returns: strSiteCode, strSiteCode
'
Sub GetLocalSMSProviderInfo(strMachine, strSiteCode)

Dim oService
Dim oProviderLocation
Dim oProviderLocationSet

Dim strQuery
Dim strCurrentMachine


On Error Resume Next

Err.Clear


'Get this machine's name.
'========================

strCurrentMachine = GetCurrentSystem()

If Err Then
Exit Sub
End If

'Connect to the WMI SMS namespace for this machine.
'==================================================

Set oService = GetObject("winmgmts:root\sms")

If Err Then
Exit Sub
End If

'Query for the SMS Provider location information for the current
'machine, the locally installed SMS Provider.
'===============================================================

strQuery = "select * from SMS_ProviderLocation where Machine='" &amp; strCurrentMachine &amp; "'"

Set oProviderLocationSet = oService.ExecQuery(strQuery)

If Not IsEmpty(oProviderLocationSet) Then

For Each oProviderLocation In oProviderLocationSet

strMachine = oProviderLocation.Machine
strSiteCode = oProviderLocation.SiteCode

Next

Set oProviderLocationSet = Nothing

End If

Set oService = Nothing

End Sub


'******************************************************************************
' Name: GetCurrentSystem
'
' Purpose: Gets the name of the current system.
'
' Parameters: None
'
' Returns: String, current system name
'
Function GetCurrentSystem()

Dim oComputerSystem
Dim oComputerSystemSet

Dim strQuery


On Error Resume Next

Err.Clear

'Initialize return value.
'========================

GetCurrentSystem = Empty

'Get the instances of computer system under the WMI CIMV2 namespace.
'There will be only one for the current system.
'===================================================================

Set oComputerSystemSet = GetObject("winmgmts:").InstancesOf("Win32_ComputerSystem")

If Err Then
Exit Function
End If

If Not IsEmpty(oComputerSystemSet) Then

For Each oComputerSystem In oComputerSystemSet

GetCurrentSystem = oComputerSystem.Name

Next

Set oComputerSystemSet = Nothing

End If

End Function


'******************************************************************************
' Name: GetSMSSSiteSystemSummarizerQuery
'
' Purpose: Gets query string for monitoring the SMS Site System Summarizer.
'
' Parameters: None
'
' Returns: String, a query
'
Function GetSMSSSiteSystemSummarizerQuery()

'Note the query should be distinct specifying SiteObject, SiteCide
'and Role but the query will contain the distinct qualifier just to
'insure that no duplicate events are raised
'==================================================================

GetSMSSSiteSystemSummarizerQuery = "select distinct " &amp; _
"System.NetbiosName, " &amp; _
"System.ResourceDomainORWorkgroup, " &amp; _
"SiteSystemSummarizer.SiteCode, " &amp; _
"SiteSystemSummarizer.SiteObject, " &amp; _
"SiteSystemSummarizer.ObjectType, " &amp; _
"SiteSystemSummarizer.Role, " &amp; _
"SiteSystemSummarizer.DownSince, " &amp; _
"SiteSystemSummarizer.PercentFree " &amp; _
"from SMS_SiteSystemSummarizer as SiteSystemSummarizer " &amp; _
"join SMS_SystemResourceList as Resource on SiteSystemSummarizer.SiteCode=Resource.SiteCode " &amp; _
"and SiteSystemSummarizer.Role=Resource.RoleName " &amp; _
"and SiteSystemSummarizer.SiteSystem=Resource.NALPath " &amp; _
"join SMS_R_System as System on System.NetbiosName=Resource.ServerName " &amp; _
"join SMS_Site as Site on SiteSystemSummarizer.SiteCode=Site.SiteCode " &amp; _
"where (Site.Version like ""4.00.%"") and " &amp; _
"((SiteSystemSummarizer.DownSince &lt;&gt; NULL) or " &amp; _
"((SiteSystemSummarizer.PercentFree &gt; 0) and (SiteSystemSummarizer.PercentFree &lt; 5)))"

End Function


'******************************************************************************
' Name: CreateEvents
'
' Purpose: To generate MOM events for the SMS Site System found in the
' specified SMS site system instance.
'
' Parameters: oInstance, a object with an embedded SMS Site System Summarizer
' object and System object meeting the query criteria and
' containing only the properties specified in the query that
' returned it from WMI.
'
Sub CreateEvents(oInstance)

Dim lEventNumber
Dim lEventType


On Error Resume Next


'Create events if the Site System is down.
'=========================================

If oInstance.SiteSystemSummarizer.DownSince Then

lEventNumber = EVENT_ID_SITE_SYSTEM_DOWN
lEventType = EVENT_TYPE_ERROR

CreateEvent lEventNumber, lEventType, oInstance

End If

'Create events if the Site System has less than 5% free space of
'
' Physical disk
' SQL data file
' SQL log file
'
'Note, that SQL Servers with autogrow are not handled. The WMI
'query against the Site System Summarizer excludes these systems.
'================================================================

If ((oInstance.SiteSystemSummarizer.PercentFree &gt; 0) And _
(oInstance.SiteSystemSummarizer.PercentFree &lt; 5)) Then

Select Case (oInstance.SiteSystemSummarizer.ObjectType)

'Physical disk space.
'====================

Case NALTYPE_NAL_PATH

lEventNumber = EVENT_ID_SITE_SYSTEM_FREE_DISK_SPACE

'SQL database data file space.
'=============================

Case NALTYPE_SQL_DATABASE

lEventNumber = EVENT_ID_SITE_SYSTEM_FREE_SQL_DATA_SPACE

'SQL database log file space.
'============================

Case NALTYPE_SQL_LOG

lEventNumber = EVENT_ID_SITE_SYSTEM_FREE_SQL_LOG_SPACE

End Select

lEventType = EVENT_TYPE_WARNING

CreateEvent lEventNumber, lEventType, oInstance

End If

End Sub


'******************************************************************************
' Name: GetErrorString
'
' Purpose: Attempts to find the description for an error if an error with
' no description is passed in.
'
' Parameters: oErr, the error object
'
' Return: String, the description for the error. (Includes the error code.)
'
Function GetErrorString(oErr)

Dim lErr, strErr


lErr = oErr
strErr = oErr.Description

On Error Resume Next

If 0 &gt;= Len(strErr) Then
' If we don't have an error description, then check to see if the error
' is a 0x8007xxxx error. If it is, then look it up.
Const ErrorMask = &amp;HFFFF0000
Const HiWord8007 = &amp;H80070000
Const LoWordMask = 65535 ' This is equivalent to 0x0000FFFF

If (lErr And ErrorMask) = HiWord8007 Then
' Attempt to use 'net helpmsg' to get a description for the error.
Dim oShell
Set oShell = CreateObject("WScript.Shell")
If Err = 0 Then
Dim oExec
Set oExec = oShell.Exec("net helpmsg " &amp; (lErr And LoWordMask))

Dim strMessage, i
Do
strMessage = oExec.stdout.ReadLine()
i = i + 1
Loop While (Len(strMessage) = 0) And (i &lt; 5)

strErr = strMessage
End If
End If
End If

GetErrorString = vbCrLf &amp; "The error returned was: '" &amp; strErr &amp; "' " &amp; lErr &amp; " (0x" &amp; Hex(lErr) &amp; ")"

End Function


'******************************************************************************
' Name: ScriptError
'
' Purpose: To generate a warning about a runtime script error.
'
' Parameters: strError, the description of the error
'
Sub ScriptError(strError)

LogEvent EVENT_ID_SCRIPTERROR, EVENT_TYPE_WARNING, "encountered a runtime error." &amp; vbCrLf &amp; "Failed to " &amp; strError

End Sub


'******************************************************************************
' Name: AccessError
'
' Purpose: To generate a warning about an access/permissions error.
'
' Parameters: strError, the description of the error
' strNameSpace, the WMI name space root
'
Sub AccessError(strError, strNameSpace)

LogEvent EVENT_ID_ACCESSDENIED, EVENT_TYPE_WARNING, "encountered a permissions error." &amp; vbCrLf &amp; _
"The script failed to " &amp; strError &amp; " in the naming context '" &amp; _
strNameSpace &amp; "' because access was denied. Alter the permissions for this " &amp; _
"name space so that the script." &amp; vbCrLf &amp; _
GetErrorString(Err)
End Sub


'******************************************************************************
' Name: LogEvent
'
' Purpose: To generate a MOM event
'
' Parameters: lEventID, the event code
' lEventType, the severity of the event
' strMessage, the message to include in the event
'
Sub LogEvent(lEventID, lEventType, strMessage)

Dim oEvent


On Error Resume Next

Set oEvent = ScriptContext.CreateEvent

oEvent.EventNumber = lEventID
oEvent.EventType = lEventType
oEvent.SetEventParameter(SCRIPT_NAME) 'Parameter1
oEvent.SetEventParameter(strMessage) 'Parameter2

oEvent.Message = "The script '%1' %2"

ScriptContext.Submit oEvent

End Sub


'******************************************************************************
' Name: CreateEvent
'
' Purpose: To generate a MOM event with parameters containing values from
' the properties in the specified SMS site system object.
'
' Parameters: lEventNumber, the event number
' lEventType, the severity of the event
' oInstance, a object with an embedded SMS Site System Summarizer
' object and System object meeting the query criteria and
' containing only the properties specified in the query that
' returned it from WMI.
'
Sub CreateEvent(lEventNumber, lEventType, oInstance)

Dim oEvent

Dim strShareName
Dim strComputerName
Dim strEventMessage


On Error Resume Next


'Get SMS Site System and MOM event objects.
'==========================================

Set oEvent = ScriptContext.CreateEvent

'Initialize common event properties.
'===================================

oEvent.EventNumber = lEventNumber
oEvent.EventType = lEventType
oEvent.Category = oInstance.SiteSystemSummarizer.SiteCode

'oEvent.SourceDomain = "DOMAIN" ' Domain of SourceComputer
'oEvent.SourceComputer = "MachineName" ' Must be a MOM Agent

oEvent.LoggingDomain = oInstance.System.ResourceDomainORWorkgroup ' Domain of LoggingComputer
oEvent.LoggingComputer = oInstance.System.NetbiosName ' Doesn't have to be a MOM Agent

strShareName = GetShareName(oInstance.SiteSystemSummarizer.SiteObject)
strComputerName = GetComputerName(oInstance.SiteSystemSummarizer.SiteObject)

oEvent.SetEventParameter(strComputerName) ' Parameter1
oEvent.SetEventParameter(oInstance.SiteSystemSummarizer.Role) ' Parameter2
oEvent.SetEventParameter(oInstance.SiteSystemSummarizer.SiteCode) ' Parameter3
oEvent.SetEventParameter(strShareName) ' Parameter4
oEvent.SetEventParameter(oInstance.SiteSystemSummarizer.SiteObject) ' Parameter5

'Initialize event specific properties.
'=====================================

Select Case (lEventNumber)

Case EVENT_ID_SITE_SYSTEM_DOWN

oEvent.SetEventParameter(oInstance.SiteSystemSummarizer.DownSince) ' Parameter6

strEventMessage = "SMS Site System " &amp; strComputerName &amp; _
" with role " &amp; "'" &amp; oInstance.SiteSystemSummarizer.Role &amp; "'" &amp; _
" is possibly down."

Case EVENT_ID_SITE_SYSTEM_FREE_DISK_SPACE

strEventMessage = "SMS Site System " &amp; strComputerName &amp; _
" has less than 5% free physical disk space on device " &amp; strShareName &amp; "."

Case EVENT_ID_SITE_SYSTEM_FREE_SQL_DATA_SPACE

strEventMessage = "SMS SQL database for site " &amp; oInstance.SiteSystemSummarizer.SiteCode &amp; _
" on system " &amp; strComputerName &amp; _
" has less than 5% free data file space and is not set to autogrow."

Case EVENT_ID_SITE_SYSTEM_FREE_SQL_LOG_SPACE

strEventMessage = "SMS SQL database for site " &amp; oInstance.SiteSystemSummarizer.SiteCode &amp; _
" on system " &amp; strComputerName &amp; _
" has less than 5% free log file space and is not set to autogrow."

End Select

oEvent.Message = strEventMessage

'Submit, raise, this event to MOM.
'=================================

ScriptContext.Submit oEvent

'Cleanup
'=======

Set oEvent = Nothing

End Sub


'******************************************************************************
' Name: GetShareName
'
' Purpose: Gets the share from the specified SiteObject NAL path.
'
' Parameters: None
'
' Returns: String, a device, share.
'
Function GetShareName(strSiteObject)

Dim intServerCharPos
Dim intShareCharPos
Dim intBackSlashCharPos


On Error Resume Next

Err.Clear


'Searching from the end of SiteObject NAL path find the beginning of
'the \\Server\Share\ path components.
'===================================================================

intServerCharPos = InStrRev(strSiteObject, "\\")

'Searching forward from \\Server\Share\ find the beginning
'character positions for Server and Share path components.
'=========================================================

intServerCharPos = intServerCharPos + 2

intShareCharPos = InStr(intServerCharPos, strSiteObject, "\")

intShareCharPos = intShareCharPos + 1

'Find the share's trailing backslash.
'====================================

intBackSlashCharPos = InStr(intShareCharPos, strSiteObject, "\")

'Extract and return the Share path component.
'============================================

GetShareName = Mid(strSiteObject, intShareCharPos, intBackSlashCharPos - intShareCharPos)

End Function


'******************************************************************************
' Name: GetComputerName
'
' Purpose: Gets the computer from the specified SiteObject NAL path.
'
' Parameters: None
'
' Returns: String, a query
'
Function GetComputerName(strSiteObject)

Dim intServerCharPos
Dim intBackSlashCharPos


On Error Resume Next

Err.Clear


'Searching from the end of SiteObject NAL path find the beginning of
'the \\Server\Share\ path components.
'===================================================================

intServerCharPos = InStrRev(strSiteObject, "\\")

'Searching forward from \\Server\Share\ find the beginning
'character positions for Server and its trailing back slash.
'===========================================================

intServerCharPos = intServerCharPos + 2

intBackSlashCharPos = InStr(intServerCharPos, strSiteObject, "\")

'Extract and return the Server path component.
'=============================================

GetComputerName = Mid(strSiteObject, intServerCharPos, intBackSlashCharPos - intServerCharPos)

End Function


'******************************************************************************
' Name: IsEventTracingEnabled
'
' Purpose: Returns the state of the EventTracingEnabled registry setting.
' This setting is directs scripts raise additional tracing MOM
' events i.e. start and completion events.
'
' Checks for the EventTracingEnabled registry value under the
' following registry paths. If the DWORD values exists, it is read.
'
' HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft Operations Manager
' HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft Operations Manager
'
' Parameters: None
'
' Returns: True if the value exists and is set to 1 else False.
'
Function IsEventTracingEnabled()

Dim strError
Dim lEventTracingEnabled

Dim objShell


On Error Resume Next


LogMessage DBG_TRACE, "Checking EventTracingEnabled registry value."

'Create the WSH Shell object for accessing the registry.
'=======================================================

Set objShell = CreateObject("WScript.Shell")

If Err.number &lt;&gt; 0 Then
IsEventTracingEnabled = False
Exit Function
End If

'Read the EventTracingEnabled value from under the MOM key.
'==========================================================

lEventTracingEnabled = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\EventTracingEnabled")

If IsEmpty(lEventTracingEnabled) Then

lEventTracingEnabled = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft Operations Manager\EventTracingEnabled")

End If

'Return the appropriate value.
'=============================

If IsEmpty(lEventTracingEnabled) Then

strError = GetErrorString(Err)
LogMessage DBG_TRACE, "Failed to read EventTracingEnabled registry value." &amp; strError

IsEventTracingEnabled = False

Else

LogMessage DBG_TRACE, "EventTracingEnabled registry value is '" &amp; lEventTracingEnabled &amp; "'."

If (lEventTracingEnabled = 1) Then
IsEventTracingEnabled = True
Else
IsEventTracingEnabled = False
End If

End If

Set objShell = Nothing

Err.Clear

End Function</Script></Body>
<Language>VBScript</Language>
<Name>ConfigMgr 2007 Monitor Site System Summarizer</Name>
<Parameters/>
<ManagementPackId>[Microsoft.SystemCenter.ConfigurationManager.2007,,1.0.0.1]</ManagementPackId>
</WriteAction>
</MemberModules>
<Composition>
<Node ID="RunScriptAction"/>
</Composition>
</Composite>
</ModuleImplementation>
<InputType>SystemLibrary!System.BaseData</InputType>
</WriteActionModuleType>