Contact Info

Crumbtrail

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

Win32_PerfRawData_UGatherer 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_PerfRawData_UGatherer 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_PerfRawData_UGatherer_SearchGathererProjects')

for obj in objWMI:
	if obj.AccessedFileRate != None:
		print("AccessedFileRate:" + str(obj.AccessedFileRate))
	if obj.AccessedFiles != None:
		print("AccessedFiles:" + str(obj.AccessedFiles))
	if obj.AdaptiveCrawlErrors != None:
		print("AdaptiveCrawlErrors:" + str(obj.AdaptiveCrawlErrors))
	if obj.Caption != None:
		print("Caption:" + str(obj.Caption))
	if obj.ChangedDocuments != None:
		print("ChangedDocuments:" + str(obj.ChangedDocuments))
	if obj.Crawlsinprogress != None:
		print("Crawlsinprogress:" + str(obj.Crawlsinprogress))
	if obj.DelayedDocuments != None:
		print("DelayedDocuments:" + str(obj.DelayedDocuments))
	if obj.Description != None:
		print("Description:" + str(obj.Description))
	if obj.DocumentAdditions != None:
		print("DocumentAdditions:" + str(obj.DocumentAdditions))
	if obj.DocumentAddRate != None:
		print("DocumentAddRate:" + str(obj.DocumentAddRate))
	if obj.DocumentDeleteRate != None:
		print("DocumentDeleteRate:" + str(obj.DocumentDeleteRate))
	if obj.DocumentDeletes != None:
		print("DocumentDeletes:" + str(obj.DocumentDeletes))
	if obj.DocumentModifies != None:
		print("DocumentModifies:" + str(obj.DocumentModifies))
	if obj.DocumentModifiesRate != None:
		print("DocumentModifiesRate:" + str(obj.DocumentModifiesRate))
	if obj.DocumentMoveandRenameRate != None:
		print("DocumentMoveandRenameRate:" + str(obj.DocumentMoveandRenameRate))
	if obj.DocumentMovesPerRenames != None:
		print("DocumentMovesPerRenames:" + str(obj.DocumentMovesPerRenames))
	if obj.DocumentsInProgress != None:
		print("DocumentsInProgress:" + str(obj.DocumentsInProgress))
	if obj.DocumentsOnHold != None:
		print("DocumentsOnHold:" + str(obj.DocumentsOnHold))
	if obj.ErrorRate != None:
		print("ErrorRate:" + str(obj.ErrorRate))
	if obj.FileErrors != None:
		print("FileErrors:" + str(obj.FileErrors))
	if obj.FileErrorsRate != None:
		print("FileErrorsRate:" + str(obj.FileErrorsRate))
	if obj.FilteredOffice != None:
		print("FilteredOffice:" + str(obj.FilteredOffice))
	if obj.FilteredOfficeRate != None:
		print("FilteredOfficeRate:" + str(obj.FilteredOfficeRate))
	if obj.FilteredText != None:
		print("FilteredText:" + str(obj.FilteredText))
	if obj.FilteredTextRate != None:
		print("FilteredTextRate:" + str(obj.FilteredTextRate))
	if obj.FilteringDocuments != None:
		print("FilteringDocuments:" + str(obj.FilteringDocuments))
	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.GathererPausedFlag != None:
		print("GathererPausedFlag:" + str(obj.GathererPausedFlag))
	if obj.HistoryRecoveryProgress != None:
		print("HistoryRecoveryProgress:" + str(obj.HistoryRecoveryProgress))
	if obj.IncrementalCrawls != None:
		print("IncrementalCrawls:" + str(obj.IncrementalCrawls))
	if obj.IteratingHistoryInProgressFlag != None:
		print("IteratingHistoryInProgressFlag:" + str(obj.IteratingHistoryInProgressFlag))
	if obj.Name != None:
		print("Name:" + str(obj.Name))
	if obj.NotModified != None:
		print("NotModified:" + str(obj.NotModified))
	if obj.ProcessedDocuments != None:
		print("ProcessedDocuments:" + str(obj.ProcessedDocuments))
	if obj.ProcessedDocumentsRate != None:
		print("ProcessedDocumentsRate:" + str(obj.ProcessedDocumentsRate))
	if obj.RecoveryInProgressFlag != None:
		print("RecoveryInProgressFlag:" + str(obj.RecoveryInProgressFlag))
	if obj.Retries != None:
		print("Retries:" + str(obj.Retries))
	if obj.RetriesRate != None:
		print("RetriesRate:" + str(obj.RetriesRate))
	if obj.StartedDocuments != None:
		print("StartedDocuments:" + str(obj.StartedDocuments))
	if obj.StatusError != None:
		print("StatusError:" + str(obj.StatusError))
	if obj.StatusSuccess != None:
		print("StatusSuccess:" + str(obj.StatusSuccess))
	if obj.SuccessRate != None:
		print("SuccessRate:" + str(obj.SuccessRate))
	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.UniqueDocuments != None:
		print("UniqueDocuments:" + str(obj.UniqueDocuments))
	if obj.URLsinHistory != None:
		print("URLsinHistory:" + str(obj.URLsinHistory))
	if obj.WaitingDocuments != None:
		print("WaitingDocuments:" + str(obj.WaitingDocuments))
	print("")
	print("########")
	print("")