Contact Info

Crumbtrail

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

Win32_PerfRawData_ESENT jscript 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_ESENT WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


Sample Code

var strComputer = ".";

var objWMIService = GetObject("winmgmts:\\\\" + strComputer + "\\root\\CIMV2");
var colItems = objWMIService.ExecQuery("SELECT * FROM Win32_PerfRawData_ESENT_Database", "WQL");

var enumItems = new Enumerator(colItems);

for (; !enumItems.atEnd(); enumItems.moveNext()) {
	var objItem = enumItems.item();
	WScript.Echo("Caption: " + objItem.Caption);
	WScript.Echo("DatabaseCacheMemoryCommitted: " + objItem.DatabaseCacheMemoryCommitted);
	WScript.Echo("DatabaseCacheMemoryCommittedMB: " + objItem.DatabaseCacheMemoryCommittedMB);
	WScript.Echo("DatabaseCacheMemoryReserved: " + objItem.DatabaseCacheMemoryReserved);
	WScript.Echo("DatabaseCacheMemoryReservedMB: " + objItem.DatabaseCacheMemoryReservedMB);
	WScript.Echo("DatabaseCacheMissesPersec: " + objItem.DatabaseCacheMissesPersec);
	WScript.Echo("DatabaseCachePercentDehydrated: " + objItem.DatabaseCachePercentDehydrated);
	WScript.Echo("DatabaseCachePercentDehydrated_Base: " + objItem.DatabaseCachePercentDehydrated_Base);
	WScript.Echo("DatabaseCachePercentHit: " + objItem.DatabaseCachePercentHit);
	WScript.Echo("DatabaseCachePercentHit_Base: " + objItem.DatabaseCachePercentHit_Base);
	WScript.Echo("DatabaseCachePercentHitUncorrelated: " + objItem.DatabaseCachePercentHitUncorrelated);
	WScript.Echo("DatabaseCachePercentHitUncorrelated_Base: " + objItem.DatabaseCachePercentHitUncorrelated_Base);
	WScript.Echo("DatabaseCacheRequestsPersec: " + objItem.DatabaseCacheRequestsPersec);
	WScript.Echo("DatabaseCacheSize: " + objItem.DatabaseCacheSize);
	WScript.Echo("DatabaseCacheSizeEffective: " + objItem.DatabaseCacheSizeEffective);
	WScript.Echo("DatabaseCacheSizeEffectiveMB: " + objItem.DatabaseCacheSizeEffectiveMB);
	WScript.Echo("DatabaseCacheSizeMB: " + objItem.DatabaseCacheSizeMB);
	WScript.Echo("DatabaseCacheSizeResident: " + objItem.DatabaseCacheSizeResident);
	WScript.Echo("DatabaseCacheSizeResidentMB: " + objItem.DatabaseCacheSizeResidentMB);
	WScript.Echo("DatabaseMaintenanceDuration: " + objItem.DatabaseMaintenanceDuration);
	WScript.Echo("DatabaseMaintenancePagesBadChecksums: " + objItem.DatabaseMaintenancePagesBadChecksums);
	WScript.Echo("DatabasePageEvictionsPersec: " + objItem.DatabasePageEvictionsPersec);
	WScript.Echo("DatabasePageFaultsPersec: " + objItem.DatabasePageFaultsPersec);
	WScript.Echo("DatabasePageFaultStallsPersec: " + objItem.DatabasePageFaultStallsPersec);
	WScript.Echo("DefragmentationTasks: " + objItem.DefragmentationTasks);
	WScript.Echo("DefragmentationTasksPending: " + objItem.DefragmentationTasksPending);
	WScript.Echo("Description: " + objItem.Description);
	WScript.Echo("Frequency_Object: " + objItem.Frequency_Object);
	WScript.Echo("Frequency_PerfTime: " + objItem.Frequency_PerfTime);
	WScript.Echo("Frequency_Sys100NS: " + objItem.Frequency_Sys100NS);
	WScript.Echo("IODatabaseReadsAttachedAverageLatency: " + objItem.IODatabaseReadsAttachedAverageLatency);
	WScript.Echo("IODatabaseReadsAttachedAverageLatency_Base: " + objItem.IODatabaseReadsAttachedAverageLatency_Base);
	WScript.Echo("IODatabaseReadsAttachedPersec: " + objItem.IODatabaseReadsAttachedPersec);
	WScript.Echo("IODatabaseReadsAverageLatency: " + objItem.IODatabaseReadsAverageLatency);
	WScript.Echo("IODatabaseReadsAverageLatency_Base: " + objItem.IODatabaseReadsAverageLatency_Base);
	WScript.Echo("IODatabaseReadsPersec: " + objItem.IODatabaseReadsPersec);
	WScript.Echo("IODatabaseReadsRecoveryAverageLatency: " + objItem.IODatabaseReadsRecoveryAverageLatency);
	WScript.Echo("IODatabaseReadsRecoveryAverageLatency_Base: " + objItem.IODatabaseReadsRecoveryAverageLatency_Base);
	WScript.Echo("IODatabaseReadsRecoveryPersec: " + objItem.IODatabaseReadsRecoveryPersec);
	WScript.Echo("IODatabaseWritesAttachedAverageLatency: " + objItem.IODatabaseWritesAttachedAverageLatency);
	WScript.Echo("IODatabaseWritesAttachedAverageLatency_Base: " + objItem.IODatabaseWritesAttachedAverageLatency_Base);
	WScript.Echo("IODatabaseWritesAttachedPersec: " + objItem.IODatabaseWritesAttachedPersec);
	WScript.Echo("IODatabaseWritesAverageLatency: " + objItem.IODatabaseWritesAverageLatency);
	WScript.Echo("IODatabaseWritesAverageLatency_Base: " + objItem.IODatabaseWritesAverageLatency_Base);
	WScript.Echo("IODatabaseWritesPersec: " + objItem.IODatabaseWritesPersec);
	WScript.Echo("IODatabaseWritesRecoveryAverageLatency: " + objItem.IODatabaseWritesRecoveryAverageLatency);
	WScript.Echo("IODatabaseWritesRecoveryAverageLatency_Base: " + objItem.IODatabaseWritesRecoveryAverageLatency_Base);
	WScript.Echo("IODatabaseWritesRecoveryPersec: " + objItem.IODatabaseWritesRecoveryPersec);
	WScript.Echo("IOLogReadsAverageLatency: " + objItem.IOLogReadsAverageLatency);
	WScript.Echo("IOLogReadsAverageLatency_Base: " + objItem.IOLogReadsAverageLatency_Base);
	WScript.Echo("IOLogReadsPersec: " + objItem.IOLogReadsPersec);
	WScript.Echo("IOLogWritesAverageLatency: " + objItem.IOLogWritesAverageLatency);
	WScript.Echo("IOLogWritesAverageLatency_Base: " + objItem.IOLogWritesAverageLatency_Base);
	WScript.Echo("IOLogWritesPersec: " + objItem.IOLogWritesPersec);
	WScript.Echo("LogBytesGeneratedPersec: " + objItem.LogBytesGeneratedPersec);
	WScript.Echo("LogBytesWritePersec: " + objItem.LogBytesWritePersec);
	WScript.Echo("LogRecordStallsPersec: " + objItem.LogRecordStallsPersec);
	WScript.Echo("LogThreadsWaiting: " + objItem.LogThreadsWaiting);
	WScript.Echo("LogWritesPersec: " + objItem.LogWritesPersec);
	WScript.Echo("Name: " + objItem.Name);
	WScript.Echo("SessionsInUse: " + objItem.SessionsInUse);
	WScript.Echo("SessionsPercentUsed: " + objItem.SessionsPercentUsed);
	WScript.Echo("SessionsPercentUsed_Base: " + objItem.SessionsPercentUsed_Base);
	WScript.Echo("TableClosesPersec: " + objItem.TableClosesPersec);
	WScript.Echo("TableOpenCacheHitsPersec: " + objItem.TableOpenCacheHitsPersec);
	WScript.Echo("TableOpenCacheMissesPersec: " + objItem.TableOpenCacheMissesPersec);
	WScript.Echo("TableOpenCachePercentHit: " + objItem.TableOpenCachePercentHit);
	WScript.Echo("TableOpenCachePercentHit_Base: " + objItem.TableOpenCachePercentHit_Base);
	WScript.Echo("TableOpensPersec: " + objItem.TableOpensPersec);
	WScript.Echo("TablesOpen: " + objItem.TablesOpen);
	WScript.Echo("Timestamp_Object: " + objItem.Timestamp_Object);
	WScript.Echo("Timestamp_PerfTime: " + objItem.Timestamp_PerfTime);
	WScript.Echo("Timestamp_Sys100NS: " + objItem.Timestamp_Sys100NS);
	WScript.Echo("VersionBucketsAllocated: " + objItem.VersionBucketsAllocated);
	WScript.Echo("")
	WScript.Echo("########")
	WScript.Echo("")
}