Contact Info

Crumbtrail

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

Win32_PerfRawData_ADWS 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_ADWS 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_ADWS_ADWS", "WQL");

foreach my $objItem (in $colItems) {
	print "ActiveWebServiceSessions: $objItem->{ActiveWebServiceSessions}\n";
	print "AllocatedConnections: $objItem->{AllocatedConnections}\n";
	print "Caption: $objItem->{Caption}\n";
	print "ChangeOptionalFeatureOperationsPerSecond: $objItem->{ChangeOptionalFeatureOperationsPerSecond}\n";
	print "ChangePasswordOperationsPerSecond: $objItem->{ChangePasswordOperationsPerSecond}\n";
	print "CreateOperationsPerSecond: $objItem->{CreateOperationsPerSecond}\n";
	print "CustomActionCacheSize: $objItem->{CustomActionCacheSize}\n";
	print "CustomActionDSRPCCacheConnectionCreationRate: $objItem->{CustomActionDSRPCCacheConnectionCreationRate}\n";
	print "CustomActionDSRPCCacheConnectionReuseRate: $objItem->{CustomActionDSRPCCacheConnectionReuseRate}\n";
	print "CustomActionDSRPCCacheMaximumPossibleSize: $objItem->{CustomActionDSRPCCacheMaximumPossibleSize}\n";
	print "CustomActionLDAPCacheConnectionCreationRate: $objItem->{CustomActionLDAPCacheConnectionCreationRate}\n";
	print "CustomActionLDAPCacheConnectionReuseRate: $objItem->{CustomActionLDAPCacheConnectionReuseRate}\n";
	print "CustomActionLDAPCacheMaximumPossibleSize: $objItem->{CustomActionLDAPCacheMaximumPossibleSize}\n";
	print "DeleteOperationsPerSecond: $objItem->{DeleteOperationsPerSecond}\n";
	print "Description: $objItem->{Description}\n";
	print "EnumerateOperationsPerSecond: $objItem->{EnumerateOperationsPerSecond}\n";
	print "Frequency_Object: $objItem->{Frequency_Object}\n";
	print "Frequency_PerfTime: $objItem->{Frequency_PerfTime}\n";
	print "Frequency_Sys100NS: $objItem->{Frequency_Sys100NS}\n";
	print "GetADDomainControllerOperationsPerSecond: $objItem->{GetADDomainControllerOperationsPerSecond}\n";
	print "GetADDomainOperationsPerSecond: $objItem->{GetADDomainOperationsPerSecond}\n";
	print "GetADForestOperationsPerSecond: $objItem->{GetADForestOperationsPerSecond}\n";
	print "GetADGroupMemberOperationsPerSecond: $objItem->{GetADGroupMemberOperationsPerSecond}\n";
	print "GetADPrincipalAuthorizationGroupOperationsPerSecond: $objItem->{GetADPrincipalAuthorizationGroupOperationsPerSecond}\n";
	print "GetADPrincipalGroupMembershipOperationsPerSecond: $objItem->{GetADPrincipalGroupMembershipOperationsPerSecond}\n";
	print "GetOperationsPerSecond: $objItem->{GetOperationsPerSecond}\n";
	print "GetVersionOperationsPerSecond: $objItem->{GetVersionOperationsPerSecond}\n";
	print "MoveADOperationMasterRoleOperationsPerSecond: $objItem->{MoveADOperationMasterRoleOperationsPerSecond}\n";
	print "Name: $objItem->{Name}\n";
	print "NonreservedConnectionsInUse: $objItem->{NonreservedConnectionsInUse}\n";
	print "NumberofDirectoryInstances: $objItem->{NumberofDirectoryInstances}\n";
	print "OpenEnumerationContexts: $objItem->{OpenEnumerationContexts}\n";
	print "OpenWebServiceSessions: $objItem->{OpenWebServiceSessions}\n";
	print "PossibleConnections: $objItem->{PossibleConnections}\n";
	print "PullOperationsPerSecond: $objItem->{PullOperationsPerSecond}\n";
	print "PutOperationsPerSecond: $objItem->{PutOperationsPerSecond}\n";
	print "ReservedConnections: $objItem->{ReservedConnections}\n";
	print "ReservedConnectionsInUse: $objItem->{ReservedConnectionsInUse}\n";
	print "SetPasswordOperationsPerSecond: $objItem->{SetPasswordOperationsPerSecond}\n";
	print "Timestamp_Object: $objItem->{Timestamp_Object}\n";
	print "Timestamp_PerfTime: $objItem->{Timestamp_PerfTime}\n";
	print "Timestamp_Sys100NS: $objItem->{Timestamp_Sys100NS}\n";
	print "TranslateNameOperationsPerSecond: $objItem->{TranslateNameOperationsPerSecond}\n";
	print "WebServiceSessionsCreatedPerSecond: $objItem->{WebServiceSessionsCreatedPerSecond}\n";
	print "\n";
	print "########\n";
	print "\n";
}