Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI » python sample

Win32_PerfFormattedData_AcdPerf python sample code

The foundations for Manageability in Windows is Windows Management Instrumentation (WMI; formerly WBEM) and WMI extensions for Windows Driver Model (WDM).

ActiveXperts Network Monitor provides the ability to build monitor check routines based on WMI. ActiveXperts has collected more than a hundred WMI samples. You can use these samples as a base for new check routines you can write yourself. The Win32_PerfFormattedData_AcdPerf WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Sample Code

from win32com.client import GetObject
objWMI = GetObject('winmgmts:').InstancesOf('Win32_PerfFormattedData_AcdPerf_LCRGS00ResponseGroupServiceHosting')

for obj in objWMI:
	if obj.Caption != None:
		print("Caption:" + str(obj.Caption))
	if obj.Description != None:
		print("Description:" + str(obj.Description))
	if obj.Frequency_Object != None:
		print("Frequency_Object:" + str(obj.Frequency_Object))
	if obj.Frequency_PerfTime != None:
		print("Frequency_PerfTime:" + str(obj.Frequency_PerfTime))
	if obj.Frequency_Sys100NS != None:
		print("Frequency_Sys100NS:" + str(obj.Frequency_Sys100NS))
	if obj.Name != None:
		print("Name:" + str(obj.Name))
	if obj.RGS000Totalnumberofincomingcallssincestartup != None:
		print("RGS000Totalnumberofincomingcallssincestartup:" + str(obj.RGS000Totalnumberofincomingcallssincestartup))
	if obj.RGS001Totalnumberofincomingcallsdeclinedbecauseofhighnumberofactivecalls != None:
		print("RGS001Totalnumberofincomingcallsdeclinedbecauseofhighnumberofactivecalls:" + str(obj.RGS001Totalnumberofincomingcallsdeclinedbecauseofhighnumberofactivecalls))
	if obj.RGS002Totalnumberofincomingcallsdeclinedbecauseofmemorypressure != None:
		print("RGS002Totalnumberofincomingcallsdeclinedbecauseofmemorypressure:" + str(obj.RGS002Totalnumberofincomingcallsdeclinedbecauseofmemorypressure))
	if obj.RGS003TotalnumberofincomingcallsdeclinedbecauseofSIPheadersthatwerenotvalid != None:
		print("RGS003TotalnumberofincomingcallsdeclinedbecauseofSIPheadersthatwerenotvalid:" + str(obj.RGS003TotalnumberofincomingcallsdeclinedbecauseofSIPheadersthatwerenotvalid))
	if obj.RGS004Totalnumberofincomingcallsdeclinedbecauseofworkflowcreationfailure != None:
		print("RGS004Totalnumberofincomingcallsdeclinedbecauseofworkflowcreationfailure:" + str(obj.RGS004Totalnumberofincomingcallsdeclinedbecauseofworkflowcreationfailure))
	if obj.RGS005Totalnumberofincomingcallsthatweredeclinedduetoworkflowstartupfailure != None:
		print("RGS005Totalnumberofincomingcallsthatweredeclinedduetoworkflowstartupfailure:" + str(obj.RGS005Totalnumberofincomingcallsthatweredeclinedduetoworkflowstartupfailure))
	if obj.RGS006Totalnumberofincomingcallsthatweredeclinedduetoconferencingattempt != None:
		print("RGS006Totalnumberofincomingcallsthatweredeclinedduetoconferencingattempt:" + str(obj.RGS006Totalnumberofincomingcallsthatweredeclinedduetoconferencingattempt))
	if obj.RGS007TotalnumberofincomingcallsthatweredeclinedduetomissingReferredByheader != None:
		print("RGS007TotalnumberofincomingcallsthatweredeclinedduetomissingReferredByheader:" + str(obj.RGS007TotalnumberofincomingcallsthatweredeclinedduetomissingReferredByheader))
	if obj.RGS008TotalnumberofincomingcallsthatdeclinedduetoMsRoutingScenarioheadernotbeingvalid != None:
		print("RGS008TotalnumberofincomingcallsthatdeclinedduetoMsRoutingScenarioheadernotbeingvalid:" + str(obj.RGS008TotalnumberofincomingcallsthatdeclinedduetoMsRoutingScenarioheadernotbeingvalid))
	if obj.RGS009TotalnumberofincomingcallsthatweredeclinedduetovideoonlySDP != None:
		print("RGS009TotalnumberofincomingcallsthatweredeclinedduetovideoonlySDP:" + str(obj.RGS009TotalnumberofincomingcallsthatweredeclinedduetovideoonlySDP))
	if obj.RGS010TotalnumberofincomingcallsthatweredeclinedbecauseofaMatchMakingfailure != None:
		print("RGS010TotalnumberofincomingcallsthatweredeclinedbecauseofaMatchMakingfailure:" + str(obj.RGS010TotalnumberofincomingcallsthatweredeclinedbecauseofaMatchMakingfailure))
	if obj.RGS011Totalnumberofunhandledexceptions != None:
		print("RGS011Totalnumberofunhandledexceptions:" + str(obj.RGS011Totalnumberofunhandledexceptions))
	if obj.RGS012Totalnumberofdifferentworkflowsloadedinmemory != None:
		print("RGS012Totalnumberofdifferentworkflowsloadedinmemory:" + str(obj.RGS012Totalnumberofdifferentworkflowsloadedinmemory))
	if obj.RGS013Totalnumberofdifferentapplicationendpoints != None:
		print("RGS013Totalnumberofdifferentapplicationendpoints:" + str(obj.RGS013Totalnumberofdifferentapplicationendpoints))
	if obj.RGS014Totalnumberofcompiledandcachedworkflowassemblies != None:
		print("RGS014Totalnumberofcompiledandcachedworkflowassemblies:" + str(obj.RGS014Totalnumberofcompiledandcachedworkflowassemblies))
	if obj.RGS015TotalnumberoffailureswhenbindingtotheCollaborationPlatform != None:
		print("RGS015TotalnumberoffailureswhenbindingtotheCollaborationPlatform:" + str(obj.RGS015TotalnumberoffailureswhenbindingtotheCollaborationPlatform))
	if obj.RGS016TotalnumberoffailureswhenbindingMatchMakingtoWCF != None:
		print("RGS016TotalnumberoffailureswhenbindingMatchMakingtoWCF:" + str(obj.RGS016TotalnumberoffailureswhenbindingMatchMakingtoWCF))
	if obj.RGS017Totalnumberofapplicationendpointbindingfailures != None:
		print("RGS017Totalnumberofapplicationendpointbindingfailures:" + str(obj.RGS017Totalnumberofapplicationendpointbindingfailures))
	if obj.RGS018Totalnumberofcertificatevalidationfailures != None:
		print("RGS018Totalnumberofcertificatevalidationfailures:" + str(obj.RGS018Totalnumberofcertificatevalidationfailures))
	if obj.RGS019Totalnumberofsuccessfulcertificatevalidations != None:
		print("RGS019Totalnumberofsuccessfulcertificatevalidations:" + str(obj.RGS019Totalnumberofsuccessfulcertificatevalidations))
	if obj.RGS020Totalnumberofapplicationendpointterminations != None:
		print("RGS020Totalnumberofapplicationendpointterminations:" + str(obj.RGS020Totalnumberofapplicationendpointterminations))
	if obj.RGS021Durationofthecallinmilliseconds != None:
		print("RGS021Durationofthecallinmilliseconds:" + str(obj.RGS021Durationofthecallinmilliseconds))
	if obj.Timestamp_Object != None:
		print("Timestamp_Object:" + str(obj.Timestamp_Object))
	if obj.Timestamp_PerfTime != None:
		print("Timestamp_PerfTime:" + str(obj.Timestamp_PerfTime))
	if obj.Timestamp_Sys100NS != None:
		print("Timestamp_Sys100NS:" + str(obj.Timestamp_Sys100NS))
	print("")
	print("########")
	print("")