Win32_PerfRawData_DNS 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_DNS 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_DNS_DNS') for obj in objWMI: if obj.AXFRRequestReceived != None: print("AXFRRequestReceived:" + str(obj.AXFRRequestReceived)) if obj.AXFRRequestSent != None: print("AXFRRequestSent:" + str(obj.AXFRRequestSent)) if obj.AXFRResponseReceived != None: print("AXFRResponseReceived:" + str(obj.AXFRResponseReceived)) if obj.AXFRSuccessReceived != None: print("AXFRSuccessReceived:" + str(obj.AXFRSuccessReceived)) if obj.AXFRSuccessSent != None: print("AXFRSuccessSent:" + str(obj.AXFRSuccessSent)) if obj.CachingMemory != None: print("CachingMemory:" + str(obj.CachingMemory)) if obj.Caption != None: print("Caption:" + str(obj.Caption)) if obj.DatabaseNodeMemory != None: print("DatabaseNodeMemory:" + str(obj.DatabaseNodeMemory)) if obj.Description != None: print("Description:" + str(obj.Description)) if obj.DynamicUpdateNoOperation != None: print("DynamicUpdateNoOperation:" + str(obj.DynamicUpdateNoOperation)) if obj.DynamicUpdateNoOperationPersec != None: print("DynamicUpdateNoOperationPersec:" + str(obj.DynamicUpdateNoOperationPersec)) if obj.DynamicUpdateQueued != None: print("DynamicUpdateQueued:" + str(obj.DynamicUpdateQueued)) if obj.DynamicUpdateReceived != None: print("DynamicUpdateReceived:" + str(obj.DynamicUpdateReceived)) if obj.DynamicUpdateReceivedPersec != None: print("DynamicUpdateReceivedPersec:" + str(obj.DynamicUpdateReceivedPersec)) if obj.DynamicUpdateRejected != None: print("DynamicUpdateRejected:" + str(obj.DynamicUpdateRejected)) if obj.DynamicUpdateTimeOuts != None: print("DynamicUpdateTimeOuts:" + str(obj.DynamicUpdateTimeOuts)) if obj.DynamicUpdateWrittentoDatabase != None: print("DynamicUpdateWrittentoDatabase:" + str(obj.DynamicUpdateWrittentoDatabase)) if obj.DynamicUpdateWrittentoDatabasePersec != None: print("DynamicUpdateWrittentoDatabasePersec:" + str(obj.DynamicUpdateWrittentoDatabasePersec)) 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.IXFRRequestReceived != None: print("IXFRRequestReceived:" + str(obj.IXFRRequestReceived)) if obj.IXFRRequestSent != None: print("IXFRRequestSent:" + str(obj.IXFRRequestSent)) if obj.IXFRResponseReceived != None: print("IXFRResponseReceived:" + str(obj.IXFRResponseReceived)) if obj.IXFRSuccessReceived != None: print("IXFRSuccessReceived:" + str(obj.IXFRSuccessReceived)) if obj.IXFRSuccessSent != None: print("IXFRSuccessSent:" + str(obj.IXFRSuccessSent)) if obj.IXFRTCPSuccessReceived != None: print("IXFRTCPSuccessReceived:" + str(obj.IXFRTCPSuccessReceived)) if obj.IXFRUDPSuccessReceived != None: print("IXFRUDPSuccessReceived:" + str(obj.IXFRUDPSuccessReceived)) if obj.Name != None: print("Name:" + str(obj.Name)) if obj.NbstatMemory != None: print("NbstatMemory:" + str(obj.NbstatMemory)) if obj.NotifyReceived != None: print("NotifyReceived:" + str(obj.NotifyReceived)) if obj.NotifySent != None: print("NotifySent:" + str(obj.NotifySent)) if obj.RecordFlowMemory != None: print("RecordFlowMemory:" + str(obj.RecordFlowMemory)) if obj.RecursiveQueries != None: print("RecursiveQueries:" + str(obj.RecursiveQueries)) if obj.RecursiveQueriesPersec != None: print("RecursiveQueriesPersec:" + str(obj.RecursiveQueriesPersec)) if obj.RecursiveQueryFailure != None: print("RecursiveQueryFailure:" + str(obj.RecursiveQueryFailure)) if obj.RecursiveQueryFailurePersec != None: print("RecursiveQueryFailurePersec:" + str(obj.RecursiveQueryFailurePersec)) if obj.RecursiveSendTimeOuts != None: print("RecursiveSendTimeOuts:" + str(obj.RecursiveSendTimeOuts)) if obj.RecursiveTimeOutPersec != None: print("RecursiveTimeOutPersec:" + str(obj.RecursiveTimeOutPersec)) if obj.SecureUpdateFailure != None: print("SecureUpdateFailure:" + str(obj.SecureUpdateFailure)) if obj.SecureUpdateReceived != None: print("SecureUpdateReceived:" + str(obj.SecureUpdateReceived)) if obj.SecureUpdateReceivedPersec != None: print("SecureUpdateReceivedPersec:" + str(obj.SecureUpdateReceivedPersec)) if obj.TCPMessageMemory != None: print("TCPMessageMemory:" + str(obj.TCPMessageMemory)) if obj.TCPQueryReceived != None: print("TCPQueryReceived:" + str(obj.TCPQueryReceived)) if obj.TCPQueryReceivedPersec != None: print("TCPQueryReceivedPersec:" + str(obj.TCPQueryReceivedPersec)) if obj.TCPResponseSent != None: print("TCPResponseSent:" + str(obj.TCPResponseSent)) if obj.TCPResponseSentPersec != None: print("TCPResponseSentPersec:" + str(obj.TCPResponseSentPersec)) 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.TotalQueryReceived != None: print("TotalQueryReceived:" + str(obj.TotalQueryReceived)) if obj.TotalQueryReceivedPersec != None: print("TotalQueryReceivedPersec:" + str(obj.TotalQueryReceivedPersec)) if obj.TotalResponseSent != None: print("TotalResponseSent:" + str(obj.TotalResponseSent)) if obj.TotalResponseSentPersec != None: print("TotalResponseSentPersec:" + str(obj.TotalResponseSentPersec)) if obj.UDPMessageMemory != None: print("UDPMessageMemory:" + str(obj.UDPMessageMemory)) if obj.UDPQueryReceived != None: print("UDPQueryReceived:" + str(obj.UDPQueryReceived)) if obj.UDPQueryReceivedPersec != None: print("UDPQueryReceivedPersec:" + str(obj.UDPQueryReceivedPersec)) if obj.UDPResponseSent != None: print("UDPResponseSent:" + str(obj.UDPResponseSent)) if obj.UDPResponseSentPersec != None: print("UDPResponseSentPersec:" + str(obj.UDPResponseSentPersec)) if obj.WINSLookupReceived != None: print("WINSLookupReceived:" + str(obj.WINSLookupReceived)) if obj.WINSLookupReceivedPersec != None: print("WINSLookupReceivedPersec:" + str(obj.WINSLookupReceivedPersec)) if obj.WINSResponseSent != None: print("WINSResponseSent:" + str(obj.WINSResponseSent)) if obj.WINSResponseSentPersec != None: print("WINSResponseSentPersec:" + str(obj.WINSResponseSentPersec)) if obj.WINSReverseLookupReceived != None: print("WINSReverseLookupReceived:" + str(obj.WINSReverseLookupReceived)) if obj.WINSReverseLookupReceivedPersec != None: print("WINSReverseLookupReceivedPersec:" + str(obj.WINSReverseLookupReceivedPersec)) if obj.WINSReverseResponseSent != None: print("WINSReverseResponseSent:" + str(obj.WINSReverseResponseSent)) if obj.WINSReverseResponseSentPersec != None: print("WINSReverseResponseSentPersec:" + str(obj.WINSReverseResponseSentPersec)) if obj.ZoneTransferFailure != None: print("ZoneTransferFailure:" + str(obj.ZoneTransferFailure)) if obj.ZoneTransferRequestReceived != None: print("ZoneTransferRequestReceived:" + str(obj.ZoneTransferRequestReceived)) if obj.ZoneTransferSOARequestSent != None: print("ZoneTransferSOARequestSent:" + str(obj.ZoneTransferSOARequestSent)) if obj.ZoneTransferSuccess != None: print("ZoneTransferSuccess:" + str(obj.ZoneTransferSuccess)) print("") print("########") print("")