Contact Info

Crumbtrail

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

Win32_PerfFormattedData_UGatherer perl 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_UGatherer WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Sample Code

use Win32::OLE('in');

my $computer = ".";

my $objWMIService = Win32::OLE->GetObject("winmgmts:\\\\$computer\\root\\CIMV2") or die "WMI connection failed.\n";
my $colItems = $objWMIService->ExecQuery("SELECT * FROM Win32_PerfFormattedData_UGatherer_SearchGathererProjects", "WQL");

foreach my $objItem (in $colItems) {
	print "AccessedFileRate: $objItem->{AccessedFileRate}\n";
	print "AccessedFiles: $objItem->{AccessedFiles}\n";
	print "AdaptiveCrawlErrors: $objItem->{AdaptiveCrawlErrors}\n";
	print "Caption: $objItem->{Caption}\n";
	print "ChangedDocuments: $objItem->{ChangedDocuments}\n";
	print "Crawlsinprogress: $objItem->{Crawlsinprogress}\n";
	print "DelayedDocuments: $objItem->{DelayedDocuments}\n";
	print "Description: $objItem->{Description}\n";
	print "DocumentAdditions: $objItem->{DocumentAdditions}\n";
	print "DocumentAddRate: $objItem->{DocumentAddRate}\n";
	print "DocumentDeleteRate: $objItem->{DocumentDeleteRate}\n";
	print "DocumentDeletes: $objItem->{DocumentDeletes}\n";
	print "DocumentModifies: $objItem->{DocumentModifies}\n";
	print "DocumentModifiesRate: $objItem->{DocumentModifiesRate}\n";
	print "DocumentMoveandRenameRate: $objItem->{DocumentMoveandRenameRate}\n";
	print "DocumentMovesPerRenames: $objItem->{DocumentMovesPerRenames}\n";
	print "DocumentsInProgress: $objItem->{DocumentsInProgress}\n";
	print "DocumentsOnHold: $objItem->{DocumentsOnHold}\n";
	print "ErrorRate: $objItem->{ErrorRate}\n";
	print "FileErrors: $objItem->{FileErrors}\n";
	print "FileErrorsRate: $objItem->{FileErrorsRate}\n";
	print "FilteredOffice: $objItem->{FilteredOffice}\n";
	print "FilteredOfficeRate: $objItem->{FilteredOfficeRate}\n";
	print "FilteredText: $objItem->{FilteredText}\n";
	print "FilteredTextRate: $objItem->{FilteredTextRate}\n";
	print "FilteringDocuments: $objItem->{FilteringDocuments}\n";
	print "Frequency_Object: $objItem->{Frequency_Object}\n";
	print "Frequency_PerfTime: $objItem->{Frequency_PerfTime}\n";
	print "Frequency_Sys100NS: $objItem->{Frequency_Sys100NS}\n";
	print "GathererPausedFlag: $objItem->{GathererPausedFlag}\n";
	print "HistoryRecoveryProgress: $objItem->{HistoryRecoveryProgress}\n";
	print "IncrementalCrawls: $objItem->{IncrementalCrawls}\n";
	print "IteratingHistoryInProgressFlag: $objItem->{IteratingHistoryInProgressFlag}\n";
	print "Name: $objItem->{Name}\n";
	print "NotModified: $objItem->{NotModified}\n";
	print "ProcessedDocuments: $objItem->{ProcessedDocuments}\n";
	print "ProcessedDocumentsRate: $objItem->{ProcessedDocumentsRate}\n";
	print "RecoveryInProgressFlag: $objItem->{RecoveryInProgressFlag}\n";
	print "Retries: $objItem->{Retries}\n";
	print "RetriesRate: $objItem->{RetriesRate}\n";
	print "StartedDocuments: $objItem->{StartedDocuments}\n";
	print "StatusError: $objItem->{StatusError}\n";
	print "StatusSuccess: $objItem->{StatusSuccess}\n";
	print "SuccessRate: $objItem->{SuccessRate}\n";
	print "Timestamp_Object: $objItem->{Timestamp_Object}\n";
	print "Timestamp_PerfTime: $objItem->{Timestamp_PerfTime}\n";
	print "Timestamp_Sys100NS: $objItem->{Timestamp_Sys100NS}\n";
	print "UniqueDocuments: $objItem->{UniqueDocuments}\n";
	print "URLsinHistory: $objItem->{URLsinHistory}\n";
	print "WaitingDocuments: $objItem->{WaitingDocuments}\n";
	print "\n";
	print "########\n";
	print "\n";
}