Contact Info

Crumbtrail

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

Win32_PerfFormattedData_WSearchIdxPi 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_WSearchIdxPi 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_WSearchIdxPi_SearchIndexer')

for obj in objWMI:
	if obj.ActiveConnections != None:
		print("ActiveConnections:" + str(obj.ActiveConnections))
	if obj.Caption != None:
		print("Caption:" + str(obj.Caption))
	if obj.CleanWidSets != None:
		print("CleanWidSets:" + str(obj.CleanWidSets))
	if obj.Description != None:
		print("Description:" + str(obj.Description))
	if obj.DirtyWidSets != None:
		print("DirtyWidSets:" + str(obj.DirtyWidSets))
	if obj.DocumentsFiltered != None:
		print("DocumentsFiltered:" + str(obj.DocumentsFiltered))
	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.IndexSize != None:
		print("IndexSize:" + str(obj.IndexSize))
	if obj.L0IndexesWordlists != None:
		print("L0IndexesWordlists:" + str(obj.L0IndexesWordlists))
	if obj.L0MergeFlushCount != None:
		print("L0MergeFlushCount:" + str(obj.L0MergeFlushCount))
	if obj.L0MergeFlushSpeedAverage != None:
		print("L0MergeFlushSpeedAverage:" + str(obj.L0MergeFlushSpeedAverage))
	if obj.L0MergeFlushSpeedLast != None:
		print("L0MergeFlushSpeedLast:" + str(obj.L0MergeFlushSpeedLast))
	if obj.L0MergesflushesNow != None:
		print("L0MergesflushesNow:" + str(obj.L0MergesflushesNow))
	if obj.L1MergeCount != None:
		print("L1MergeCount:" + str(obj.L1MergeCount))
	if obj.L1MergesNow != None:
		print("L1MergesNow:" + str(obj.L1MergesNow))
	if obj.L1MergeSpeedaverage != None:
		print("L1MergeSpeedaverage:" + str(obj.L1MergeSpeedaverage))
	if obj.L1MergeSpeedlast != None:
		print("L1MergeSpeedlast:" + str(obj.L1MergeSpeedlast))
	if obj.L2MergeCount != None:
		print("L2MergeCount:" + str(obj.L2MergeCount))
	if obj.L2MergesNow != None:
		print("L2MergesNow:" + str(obj.L2MergesNow))
	if obj.L2MergeSpeedaverage != None:
		print("L2MergeSpeedaverage:" + str(obj.L2MergeSpeedaverage))
	if obj.L2MergeSpeedlast != None:
		print("L2MergeSpeedlast:" + str(obj.L2MergeSpeedlast))
	if obj.L3MergeCount != None:
		print("L3MergeCount:" + str(obj.L3MergeCount))
	if obj.L3MergesNow != None:
		print("L3MergesNow:" + str(obj.L3MergesNow))
	if obj.L3MergeSpeedaverage != None:
		print("L3MergeSpeedaverage:" + str(obj.L3MergeSpeedaverage))
	if obj.L3MergeSpeedlast != None:
		print("L3MergeSpeedlast:" + str(obj.L3MergeSpeedlast))
	if obj.L4MergeCount != None:
		print("L4MergeCount:" + str(obj.L4MergeCount))
	if obj.L4MergesNow != None:
		print("L4MergesNow:" + str(obj.L4MergesNow))
	if obj.L4MergeSpeedaverage != None:
		print("L4MergeSpeedaverage:" + str(obj.L4MergeSpeedaverage))
	if obj.L4MergeSpeedlast != None:
		print("L4MergeSpeedlast:" + str(obj.L4MergeSpeedlast))
	if obj.L5MergeCount != None:
		print("L5MergeCount:" + str(obj.L5MergeCount))
	if obj.L5MergesNow != None:
		print("L5MergesNow:" + str(obj.L5MergesNow))
	if obj.L5MergeSpeedaverage != None:
		print("L5MergeSpeedaverage:" + str(obj.L5MergeSpeedaverage))
	if obj.L5MergeSpeedlast != None:
		print("L5MergeSpeedlast:" + str(obj.L5MergeSpeedlast))
	if obj.L6MergeCount != None:
		print("L6MergeCount:" + str(obj.L6MergeCount))
	if obj.L6MergesNow != None:
		print("L6MergesNow:" + str(obj.L6MergesNow))
	if obj.L6MergeSpeedaverage != None:
		print("L6MergeSpeedaverage:" + str(obj.L6MergeSpeedaverage))
	if obj.L6MergeSpeedlast != None:
		print("L6MergeSpeedlast:" + str(obj.L6MergeSpeedlast))
	if obj.L7MergeCount != None:
		print("L7MergeCount:" + str(obj.L7MergeCount))
	if obj.L7MergesNow != None:
		print("L7MergesNow:" + str(obj.L7MergesNow))
	if obj.L7MergeSpeedaverage != None:
		print("L7MergeSpeedaverage:" + str(obj.L7MergeSpeedaverage))
	if obj.L7MergeSpeedlast != None:
		print("L7MergeSpeedlast:" + str(obj.L7MergeSpeedlast))
	if obj.L8MergeCount != None:
		print("L8MergeCount:" + str(obj.L8MergeCount))
	if obj.L8MergesNow != None:
		print("L8MergesNow:" + str(obj.L8MergesNow))
	if obj.L8MergeSpeedaverage != None:
		print("L8MergeSpeedaverage:" + str(obj.L8MergeSpeedaverage))
	if obj.L8MergeSpeedlast != None:
		print("L8MergeSpeedlast:" + str(obj.L8MergeSpeedlast))
	if obj.MasterIndexLevel != None:
		print("MasterIndexLevel:" + str(obj.MasterIndexLevel))
	if obj.MasterMergeProgress != None:
		print("MasterMergeProgress:" + str(obj.MasterMergeProgress))
	if obj.MasterMergesNow != None:
		print("MasterMergesNow:" + str(obj.MasterMergesNow))
	if obj.MasterMergestoDate != None:
		print("MasterMergestoDate:" + str(obj.MasterMergestoDate))
	if obj.Name != None:
		print("Name:" + str(obj.Name))
	if obj.PersistentIndexes != None:
		print("PersistentIndexes:" + str(obj.PersistentIndexes))
	if obj.PersistentIndexesL1 != None:
		print("PersistentIndexesL1:" + str(obj.PersistentIndexesL1))
	if obj.PersistentIndexesL2 != None:
		print("PersistentIndexesL2:" + str(obj.PersistentIndexesL2))
	if obj.PersistentIndexesL3 != None:
		print("PersistentIndexesL3:" + str(obj.PersistentIndexesL3))
	if obj.PersistentIndexesL4 != None:
		print("PersistentIndexesL4:" + str(obj.PersistentIndexesL4))
	if obj.PersistentIndexesL5 != None:
		print("PersistentIndexesL5:" + str(obj.PersistentIndexesL5))
	if obj.PersistentIndexesL6 != None:
		print("PersistentIndexesL6:" + str(obj.PersistentIndexesL6))
	if obj.PersistentIndexesL7 != None:
		print("PersistentIndexesL7:" + str(obj.PersistentIndexesL7))
	if obj.PersistentIndexesL8 != None:
		print("PersistentIndexesL8:" + str(obj.PersistentIndexesL8))
	if obj.Queries != None:
		print("Queries:" + str(obj.Queries))
	if obj.QueriesFailed != None:
		print("QueriesFailed:" + str(obj.QueriesFailed))
	if obj.QueriesSucceeded != None:
		print("QueriesSucceeded:" + str(obj.QueriesSucceeded))
	if obj.ShadowMergeLevels != None:
		print("ShadowMergeLevels:" + str(obj.ShadowMergeLevels))
	if obj.ShadowMergeLevelsThreshold != None:
		print("ShadowMergeLevelsThreshold:" + str(obj.ShadowMergeLevelsThreshold))
	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))
	if obj.UniqueKeys != None:
		print("UniqueKeys:" + str(obj.UniqueKeys))
	if obj.WorkItemsCreated != None:
		print("WorkItemsCreated:" + str(obj.WorkItemsCreated))
	if obj.WorkItemsDeleted != None:
		print("WorkItemsDeleted:" + str(obj.WorkItemsDeleted))
	print("")
	print("########")
	print("")