Tagged: Monitor

Monitor connected consoles

A small and simple script to monitor number of connected SCOM-consoles.

Set oLocator = CreateObject("WbemScripting.SWbemLocator")
Set oWmi = oLocator.ConnectServer(".", "root/snmp/localhost", "")
Set oStats = oWmi.ExecQuery("select * from SNMP_RFC1213_MIB_tcpConnTable where tcpConnLocalPort = 5724 AND tcpConnLocalAddress <> '0.0.0.0' AND tcpConnLocalAddress <> '127.0.0.1'")

Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
oBag.AddValue "ConnectedConsoles", oStats.Count
oAPI.AddItem(oBag)
oAPI.ReturnItems

Monitor COM+ Call Time

With a little help from Egilh you can monitor the Call Time on your COM-objects in MOM…

First, download and install the DLL on the server you want to monitor, then use this script:

'-------------------------------------------------------------------------------------
' Script to montior COM-obecjt call time
'
'                                         Rikard Rönnkvist / snowland.se / 2008-09-16
'-------------------------------------------------------------------------------------

'Get the com+ call times
Set oTracker = CreateObject("egilh.ComTracker")
sResult = oTracker.getStatistics()
	
'Display call times
Set oDOM = CreateObject("MSXML2.DomDocument.3.0")
oDOM.loadXML (sResult)

For Each oNode In oDOM.selectNodes("/applications/application/classes/class")
	' Create performance data
	Set oPerfData = ScriptContext.CreatePerfData
	With oPerfData
		.ObjectName = "COM-Objects"
		.InstanceName = oNode.selectSingleNode("progID").Text
		.CounterName = "CallTime"
		.Value = oNode.selectSingleNode("responseTime").Text
	End With
	ScriptContext.Submit oPerfData
	Set oPerfData = Nothing
Next

MOM-Script: ServiceMonitor

Ett script som kontrollerar om en service har hängt sig under uppstart/nersängning.

Parametrar

  • ServiceName = wuauserv (Service att övervaka)
  • RecheckSeconds = 20 (Sekunder mellan kontroller)
  • RecheckCount = 3 (Antal kontroller att göra)
  • DebugMode = False (Skapa event oavsett status? Vid felsökning)

Script: ServiceMonitor.vbs