Contact Info

Crumbtrail

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

Win32_PerfRawData_ASPNET4030319 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_PerfRawData_ASPNET4030319 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_PerfRawData_ASPNET4030319_ASPNETAppsv4030319", "WQL");

foreach my $objItem (in $colItems) {
	print "AnonymousRequests: $objItem->{AnonymousRequests}\n";
	print "AnonymousRequestsPerSec: $objItem->{AnonymousRequestsPerSec}\n";
	print "ApplicationLifetimeEvents: $objItem->{ApplicationLifetimeEvents}\n";
	print "ApplicationLifetimeEventsPerSec: $objItem->{ApplicationLifetimeEventsPerSec}\n";
	print "AuditFailureEventsRaised: $objItem->{AuditFailureEventsRaised}\n";
	print "AuditSuccessEventsRaised: $objItem->{AuditSuccessEventsRaised}\n";
	print "CacheAPIEntries: $objItem->{CacheAPIEntries}\n";
	print "CacheAPIHitRatio: $objItem->{CacheAPIHitRatio}\n";
	print "CacheAPIHitRatio_Base: $objItem->{CacheAPIHitRatio_Base}\n";
	print "CacheAPIHits: $objItem->{CacheAPIHits}\n";
	print "CacheAPIMisses: $objItem->{CacheAPIMisses}\n";
	print "CacheAPITrims: $objItem->{CacheAPITrims}\n";
	print "CacheAPITurnoverRate: $objItem->{CacheAPITurnoverRate}\n";
	print "CachePercentMachineMemoryLimitUsed: $objItem->{CachePercentMachineMemoryLimitUsed}\n";
	print "CachePercentMachineMemoryLimitUsed_Base: $objItem->{CachePercentMachineMemoryLimitUsed_Base}\n";
	print "CachePercentProcessMemoryLimitUsed: $objItem->{CachePercentProcessMemoryLimitUsed}\n";
	print "CachePercentProcessMemoryLimitUsed_Base: $objItem->{CachePercentProcessMemoryLimitUsed_Base}\n";
	print "CacheTotalEntries: $objItem->{CacheTotalEntries}\n";
	print "CacheTotalHitRatio: $objItem->{CacheTotalHitRatio}\n";
	print "CacheTotalHitRatio_Base: $objItem->{CacheTotalHitRatio_Base}\n";
	print "CacheTotalHits: $objItem->{CacheTotalHits}\n";
	print "CacheTotalMisses: $objItem->{CacheTotalMisses}\n";
	print "CacheTotalTrims: $objItem->{CacheTotalTrims}\n";
	print "CacheTotalTurnoverRate: $objItem->{CacheTotalTurnoverRate}\n";
	print "Caption: $objItem->{Caption}\n";
	print "CompilationsTotal: $objItem->{CompilationsTotal}\n";
	print "DebuggingRequests: $objItem->{DebuggingRequests}\n";
	print "Description: $objItem->{Description}\n";
	print "ErrorEventsRaised: $objItem->{ErrorEventsRaised}\n";
	print "ErrorEventsRaisedPerSec: $objItem->{ErrorEventsRaisedPerSec}\n";
	print "ErrorsDuringCompilation: $objItem->{ErrorsDuringCompilation}\n";
	print "ErrorsDuringExecution: $objItem->{ErrorsDuringExecution}\n";
	print "ErrorsDuringPreprocessing: $objItem->{ErrorsDuringPreprocessing}\n";
	print "ErrorsTotal: $objItem->{ErrorsTotal}\n";
	print "ErrorsTotalPerSec: $objItem->{ErrorsTotalPerSec}\n";
	print "ErrorsUnhandledDuringExecution: $objItem->{ErrorsUnhandledDuringExecution}\n";
	print "ErrorsUnhandledDuringExecutionPerSec: $objItem->{ErrorsUnhandledDuringExecutionPerSec}\n";
	print "EventsRaised: $objItem->{EventsRaised}\n";
	print "EventsRaisedPerSec: $objItem->{EventsRaisedPerSec}\n";
	print "FormsAuthenticationFailure: $objItem->{FormsAuthenticationFailure}\n";
	print "FormsAuthenticationSuccess: $objItem->{FormsAuthenticationSuccess}\n";
	print "Frequency_Object: $objItem->{Frequency_Object}\n";
	print "Frequency_PerfTime: $objItem->{Frequency_PerfTime}\n";
	print "Frequency_Sys100NS: $objItem->{Frequency_Sys100NS}\n";
	print "InfrastructureErrorEventsRaised: $objItem->{InfrastructureErrorEventsRaised}\n";
	print "InfrastructureErrorEventsRaisedPerSec: $objItem->{InfrastructureErrorEventsRaisedPerSec}\n";
	print "ManagedMemoryUsedestimated: $objItem->{ManagedMemoryUsedestimated}\n";
	print "MembershipAuthenticationFailure: $objItem->{MembershipAuthenticationFailure}\n";
	print "MembershipAuthenticationSuccess: $objItem->{MembershipAuthenticationSuccess}\n";
	print "Name: $objItem->{Name}\n";
	print "OutputCacheEntries: $objItem->{OutputCacheEntries}\n";
	print "OutputCacheHitRatio: $objItem->{OutputCacheHitRatio}\n";
	print "OutputCacheHitRatio_Base: $objItem->{OutputCacheHitRatio_Base}\n";
	print "OutputCacheHits: $objItem->{OutputCacheHits}\n";
	print "OutputCacheMisses: $objItem->{OutputCacheMisses}\n";
	print "OutputCacheTrims: $objItem->{OutputCacheTrims}\n";
	print "OutputCacheTurnoverRate: $objItem->{OutputCacheTurnoverRate}\n";
	print "PercentManagedProcessorTimeestimated: $objItem->{PercentManagedProcessorTimeestimated}\n";
	print "PercentManagedProcessorTimeestimated_Base: $objItem->{PercentManagedProcessorTimeestimated_Base}\n";
	print "PipelineInstanceCount: $objItem->{PipelineInstanceCount}\n";
	print "RequestBytesInTotal: $objItem->{RequestBytesInTotal}\n";
	print "RequestBytesInTotalWebSockets: $objItem->{RequestBytesInTotalWebSockets}\n";
	print "RequestBytesOutTotal: $objItem->{RequestBytesOutTotal}\n";
	print "RequestBytesOutTotalWebSockets: $objItem->{RequestBytesOutTotalWebSockets}\n";
	print "RequestErrorEventsRaised: $objItem->{RequestErrorEventsRaised}\n";
	print "RequestErrorEventsRaisedPerSec: $objItem->{RequestErrorEventsRaisedPerSec}\n";
	print "RequestEventsRaised: $objItem->{RequestEventsRaised}\n";
	print "RequestEventsRaisedPerSec: $objItem->{RequestEventsRaisedPerSec}\n";
	print "RequestExecutionTime: $objItem->{RequestExecutionTime}\n";
	print "RequestsDisconnected: $objItem->{RequestsDisconnected}\n";
	print "RequestsExecuting: $objItem->{RequestsExecuting}\n";
	print "RequestsExecutingWebSockets: $objItem->{RequestsExecutingWebSockets}\n";
	print "RequestsFailed: $objItem->{RequestsFailed}\n";
	print "RequestsFailedWebSockets: $objItem->{RequestsFailedWebSockets}\n";
	print "RequestsInApplicationQueue: $objItem->{RequestsInApplicationQueue}\n";
	print "RequestsNotAuthorized: $objItem->{RequestsNotAuthorized}\n";
	print "RequestsNotFound: $objItem->{RequestsNotFound}\n";
	print "RequestsPerSec: $objItem->{RequestsPerSec}\n";
	print "RequestsRejected: $objItem->{RequestsRejected}\n";
	print "RequestsSucceeded: $objItem->{RequestsSucceeded}\n";
	print "RequestsSucceededWebSockets: $objItem->{RequestsSucceededWebSockets}\n";
	print "RequestsTimedOut: $objItem->{RequestsTimedOut}\n";
	print "RequestsTotal: $objItem->{RequestsTotal}\n";
	print "RequestsTotalWebSockets: $objItem->{RequestsTotalWebSockets}\n";
	print "RequestWaitTime: $objItem->{RequestWaitTime}\n";
	print "SessionsAbandoned: $objItem->{SessionsAbandoned}\n";
	print "SessionsActive: $objItem->{SessionsActive}\n";
	print "SessionSQLServerconnectionstotal: $objItem->{SessionSQLServerconnectionstotal}\n";
	print "SessionStateServerconnectionstotal: $objItem->{SessionStateServerconnectionstotal}\n";
	print "SessionsTimedOut: $objItem->{SessionsTimedOut}\n";
	print "SessionsTotal: $objItem->{SessionsTotal}\n";
	print "Timestamp_Object: $objItem->{Timestamp_Object}\n";
	print "Timestamp_PerfTime: $objItem->{Timestamp_PerfTime}\n";
	print "Timestamp_Sys100NS: $objItem->{Timestamp_Sys100NS}\n";
	print "TransactionsAborted: $objItem->{TransactionsAborted}\n";
	print "TransactionsCommitted: $objItem->{TransactionsCommitted}\n";
	print "TransactionsPending: $objItem->{TransactionsPending}\n";
	print "TransactionsPerSec: $objItem->{TransactionsPerSec}\n";
	print "TransactionsTotal: $objItem->{TransactionsTotal}\n";
	print "ViewstateMACValidationFailure: $objItem->{ViewstateMACValidationFailure}\n";
	print "\n";
	print "########\n";
	print "\n";
}