Contact Info

Crumbtrail

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

Win32_PerfRawData_ESENT vbscript 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

Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")

Set colItems = objWMIService.ExecQuery("Select * From Win32_PerfRawData_ESENT_Database")

For Each objItem in colItems
	WScript.Echo "Caption:" & objItem.Caption
	WScript.Echo "DatabaseCacheMissesPersec:" & objItem.DatabaseCacheMissesPersec
	WScript.Echo "DatabaseCachePercentHit:" & objItem.DatabaseCachePercentHit
	WScript.Echo "DatabaseCachePercentHit_Base:" & objItem.DatabaseCachePercentHit_Base
	WScript.Echo "DatabaseCacheRequestsPersec:" & objItem.DatabaseCacheRequestsPersec
	WScript.Echo "DatabaseCacheSize:" & objItem.DatabaseCacheSize
	WScript.Echo "DatabaseCacheSizeMB:" & objItem.DatabaseCacheSizeMB
	WScript.Echo "DatabaseCacheSizeResident:" & objItem.DatabaseCacheSizeResident
	WScript.Echo "DatabaseCacheSizeResidentMB:" & objItem.DatabaseCacheSizeResidentMB
	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 "IODatabaseReadsAverageLatency:" & objItem.IODatabaseReadsAverageLatency
	WScript.Echo "IODatabaseReadsAverageLatency_Base:" & objItem.IODatabaseReadsAverageLatency_Base
	WScript.Echo "IODatabaseReadsPersec:" & objItem.IODatabaseReadsPersec
	WScript.Echo "IODatabaseWritesAverageLatency:" & objItem.IODatabaseWritesAverageLatency
	WScript.Echo "IODatabaseWritesAverageLatency_Base:" & objItem.IODatabaseWritesAverageLatency_Base
	WScript.Echo "IODatabaseWritesPersec:" & objItem.IODatabaseWritesPersec
	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 "PagesConverted:" & objItem.PagesConverted
	WScript.Echo "PagesConvertedPersec:" & objItem.PagesConvertedPersec
	WScript.Echo "RecordsConverted:" & objItem.RecordsConverted
	WScript.Echo "RecordsConvertedPersec:" & objItem.RecordsConvertedPersec
	WScript.Echo "SessionsInUse:" & objItem.SessionsInUse
	WScript.Echo "SessionsPercentUsed:" & objItem.SessionsPercentUsed
	WScript.Echo "SessionsPercentUsed_Base:" & objItem.SessionsPercentUsed_Base
	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 "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 ""
Next