Win32_PerfRawData_ESENT python 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
from win32com.client import GetObject objWMI = GetObject('winmgmts:').InstancesOf('Win32_PerfRawData_ESENT_Database') for obj in objWMI: if obj.Caption != None: print("Caption:" + str(obj.Caption)) if obj.DatabaseCacheMemoryCommitted != None: print("DatabaseCacheMemoryCommitted:" + str(obj.DatabaseCacheMemoryCommitted)) if obj.DatabaseCacheMemoryCommittedMB != None: print("DatabaseCacheMemoryCommittedMB:" + str(obj.DatabaseCacheMemoryCommittedMB)) if obj.DatabaseCacheMemoryReserved != None: print("DatabaseCacheMemoryReserved:" + str(obj.DatabaseCacheMemoryReserved)) if obj.DatabaseCacheMemoryReservedMB != None: print("DatabaseCacheMemoryReservedMB:" + str(obj.DatabaseCacheMemoryReservedMB)) if obj.DatabaseCacheMissesPersec != None: print("DatabaseCacheMissesPersec:" + str(obj.DatabaseCacheMissesPersec)) if obj.DatabaseCachePercentDehydrated != None: print("DatabaseCachePercentDehydrated:" + str(obj.DatabaseCachePercentDehydrated)) if obj.DatabaseCachePercentDehydrated_Base != None: print("DatabaseCachePercentDehydrated_Base:" + str(obj.DatabaseCachePercentDehydrated_Base)) if obj.DatabaseCachePercentHit != None: print("DatabaseCachePercentHit:" + str(obj.DatabaseCachePercentHit)) if obj.DatabaseCachePercentHit_Base != None: print("DatabaseCachePercentHit_Base:" + str(obj.DatabaseCachePercentHit_Base)) if obj.DatabaseCachePercentHitUncorrelated != None: print("DatabaseCachePercentHitUncorrelated:" + str(obj.DatabaseCachePercentHitUncorrelated)) if obj.DatabaseCachePercentHitUncorrelated_Base != None: print("DatabaseCachePercentHitUncorrelated_Base:" + str(obj.DatabaseCachePercentHitUncorrelated_Base)) if obj.DatabaseCacheRequestsPersec != None: print("DatabaseCacheRequestsPersec:" + str(obj.DatabaseCacheRequestsPersec)) if obj.DatabaseCacheSize != None: print("DatabaseCacheSize:" + str(obj.DatabaseCacheSize)) if obj.DatabaseCacheSizeEffective != None: print("DatabaseCacheSizeEffective:" + str(obj.DatabaseCacheSizeEffective)) if obj.DatabaseCacheSizeEffectiveMB != None: print("DatabaseCacheSizeEffectiveMB:" + str(obj.DatabaseCacheSizeEffectiveMB)) if obj.DatabaseCacheSizeMB != None: print("DatabaseCacheSizeMB:" + str(obj.DatabaseCacheSizeMB)) if obj.DatabaseCacheSizeResident != None: print("DatabaseCacheSizeResident:" + str(obj.DatabaseCacheSizeResident)) if obj.DatabaseCacheSizeResidentMB != None: print("DatabaseCacheSizeResidentMB:" + str(obj.DatabaseCacheSizeResidentMB)) if obj.DatabaseMaintenanceDuration != None: print("DatabaseMaintenanceDuration:" + str(obj.DatabaseMaintenanceDuration)) if obj.DatabaseMaintenancePagesBadChecksums != None: print("DatabaseMaintenancePagesBadChecksums:" + str(obj.DatabaseMaintenancePagesBadChecksums)) if obj.DatabasePageEvictionsPersec != None: print("DatabasePageEvictionsPersec:" + str(obj.DatabasePageEvictionsPersec)) if obj.DatabasePageFaultsPersec != None: print("DatabasePageFaultsPersec:" + str(obj.DatabasePageFaultsPersec)) if obj.DatabasePageFaultStallsPersec != None: print("DatabasePageFaultStallsPersec:" + str(obj.DatabasePageFaultStallsPersec)) if obj.DefragmentationTasks != None: print("DefragmentationTasks:" + str(obj.DefragmentationTasks)) if obj.DefragmentationTasksPending != None: print("DefragmentationTasksPending:" + str(obj.DefragmentationTasksPending)) if obj.Description != None: print("Description:" + str(obj.Description)) if obj.Frequency_Object != None: print("Frequency_Object:" + str(obj.Frequency_Object)) if obj.Frequency_PerfTime != None: print("Frequency_PerfTime:" + str(obj.Frequency_PerfTime)) if obj.Frequency_Sys100NS != None: print("Frequency_Sys100NS:" + str(obj.Frequency_Sys100NS)) if obj.IODatabaseReadsAttachedAverageLatency != None: print("IODatabaseReadsAttachedAverageLatency:" + str(obj.IODatabaseReadsAttachedAverageLatency)) if obj.IODatabaseReadsAttachedAverageLatency_Base != None: print("IODatabaseReadsAttachedAverageLatency_Base:" + str(obj.IODatabaseReadsAttachedAverageLatency_Base)) if obj.IODatabaseReadsAttachedPersec != None: print("IODatabaseReadsAttachedPersec:" + str(obj.IODatabaseReadsAttachedPersec)) if obj.IODatabaseReadsAverageLatency != None: print("IODatabaseReadsAverageLatency:" + str(obj.IODatabaseReadsAverageLatency)) if obj.IODatabaseReadsAverageLatency_Base != None: print("IODatabaseReadsAverageLatency_Base:" + str(obj.IODatabaseReadsAverageLatency_Base)) if obj.IODatabaseReadsPersec != None: print("IODatabaseReadsPersec:" + str(obj.IODatabaseReadsPersec)) if obj.IODatabaseReadsRecoveryAverageLatency != None: print("IODatabaseReadsRecoveryAverageLatency:" + str(obj.IODatabaseReadsRecoveryAverageLatency)) if obj.IODatabaseReadsRecoveryAverageLatency_Base != None: print("IODatabaseReadsRecoveryAverageLatency_Base:" + str(obj.IODatabaseReadsRecoveryAverageLatency_Base)) if obj.IODatabaseReadsRecoveryPersec != None: print("IODatabaseReadsRecoveryPersec:" + str(obj.IODatabaseReadsRecoveryPersec)) if obj.IODatabaseWritesAttachedAverageLatency != None: print("IODatabaseWritesAttachedAverageLatency:" + str(obj.IODatabaseWritesAttachedAverageLatency)) if obj.IODatabaseWritesAttachedAverageLatency_Base != None: print("IODatabaseWritesAttachedAverageLatency_Base:" + str(obj.IODatabaseWritesAttachedAverageLatency_Base)) if obj.IODatabaseWritesAttachedPersec != None: print("IODatabaseWritesAttachedPersec:" + str(obj.IODatabaseWritesAttachedPersec)) if obj.IODatabaseWritesAverageLatency != None: print("IODatabaseWritesAverageLatency:" + str(obj.IODatabaseWritesAverageLatency)) if obj.IODatabaseWritesAverageLatency_Base != None: print("IODatabaseWritesAverageLatency_Base:" + str(obj.IODatabaseWritesAverageLatency_Base)) if obj.IODatabaseWritesPersec != None: print("IODatabaseWritesPersec:" + str(obj.IODatabaseWritesPersec)) if obj.IODatabaseWritesRecoveryAverageLatency != None: print("IODatabaseWritesRecoveryAverageLatency:" + str(obj.IODatabaseWritesRecoveryAverageLatency)) if obj.IODatabaseWritesRecoveryAverageLatency_Base != None: print("IODatabaseWritesRecoveryAverageLatency_Base:" + str(obj.IODatabaseWritesRecoveryAverageLatency_Base)) if obj.IODatabaseWritesRecoveryPersec != None: print("IODatabaseWritesRecoveryPersec:" + str(obj.IODatabaseWritesRecoveryPersec)) if obj.IOLogReadsAverageLatency != None: print("IOLogReadsAverageLatency:" + str(obj.IOLogReadsAverageLatency)) if obj.IOLogReadsAverageLatency_Base != None: print("IOLogReadsAverageLatency_Base:" + str(obj.IOLogReadsAverageLatency_Base)) if obj.IOLogReadsPersec != None: print("IOLogReadsPersec:" + str(obj.IOLogReadsPersec)) if obj.IOLogWritesAverageLatency != None: print("IOLogWritesAverageLatency:" + str(obj.IOLogWritesAverageLatency)) if obj.IOLogWritesAverageLatency_Base != None: print("IOLogWritesAverageLatency_Base:" + str(obj.IOLogWritesAverageLatency_Base)) if obj.IOLogWritesPersec != None: print("IOLogWritesPersec:" + str(obj.IOLogWritesPersec)) if obj.LogBytesGeneratedPersec != None: print("LogBytesGeneratedPersec:" + str(obj.LogBytesGeneratedPersec)) if obj.LogBytesWritePersec != None: print("LogBytesWritePersec:" + str(obj.LogBytesWritePersec)) if obj.LogRecordStallsPersec != None: print("LogRecordStallsPersec:" + str(obj.LogRecordStallsPersec)) if obj.LogThreadsWaiting != None: print("LogThreadsWaiting:" + str(obj.LogThreadsWaiting)) if obj.LogWritesPersec != None: print("LogWritesPersec:" + str(obj.LogWritesPersec)) if obj.Name != None: print("Name:" + str(obj.Name)) if obj.SessionsInUse != None: print("SessionsInUse:" + str(obj.SessionsInUse)) if obj.SessionsPercentUsed != None: print("SessionsPercentUsed:" + str(obj.SessionsPercentUsed)) if obj.SessionsPercentUsed_Base != None: print("SessionsPercentUsed_Base:" + str(obj.SessionsPercentUsed_Base)) if obj.TableClosesPersec != None: print("TableClosesPersec:" + str(obj.TableClosesPersec)) if obj.TableOpenCacheHitsPersec != None: print("TableOpenCacheHitsPersec:" + str(obj.TableOpenCacheHitsPersec)) if obj.TableOpenCacheMissesPersec != None: print("TableOpenCacheMissesPersec:" + str(obj.TableOpenCacheMissesPersec)) if obj.TableOpenCachePercentHit != None: print("TableOpenCachePercentHit:" + str(obj.TableOpenCachePercentHit)) if obj.TableOpenCachePercentHit_Base != None: print("TableOpenCachePercentHit_Base:" + str(obj.TableOpenCachePercentHit_Base)) if obj.TableOpensPersec != None: print("TableOpensPersec:" + str(obj.TableOpensPersec)) if obj.TablesOpen != None: print("TablesOpen:" + str(obj.TablesOpen)) if obj.Timestamp_Object != None: print("Timestamp_Object:" + str(obj.Timestamp_Object)) if obj.Timestamp_PerfTime != None: print("Timestamp_PerfTime:" + str(obj.Timestamp_PerfTime)) if obj.Timestamp_Sys100NS != None: print("Timestamp_Sys100NS:" + str(obj.Timestamp_Sys100NS)) if obj.VersionBucketsAllocated != None: print("VersionBucketsAllocated:" + str(obj.VersionBucketsAllocated)) print("") print("########") print("")