Contact Info

Crumbtrail

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

Win32_PerfRawData_QmsAgentPerf 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_QmsAgentPerf 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_QmsAgentPerf_LCQMSAgent00QoEMonitoringServerAgent')

for obj in objWMI:
	if obj.Caption != None:
		print("Caption:" + str(obj.Caption))
	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.Name != None:
		print("Name:" + str(obj.Name))
	if obj.QMSAgent000Totalnumberofmetricsreportsreceived != None:
		print("QMSAgent000Totalnumberofmetricsreportsreceived:" + str(obj.QMSAgent000Totalnumberofmetricsreportsreceived))
	if obj.QMSAgent001Numberofmetricsreportsreceivedpersecond != None:
		print("QMSAgent001Numberofmetricsreportsreceivedpersecond:" + str(obj.QMSAgent001Numberofmetricsreportsreceivedpersecond))
	if obj.QMSAgent002Totalnumberofmetricsreportsaccepted != None:
		print("QMSAgent002Totalnumberofmetricsreportsaccepted:" + str(obj.QMSAgent002Totalnumberofmetricsreportsaccepted))
	if obj.QMSAgent003Numberofmetricsreportsacceptedpersecond != None:
		print("QMSAgent003Numberofmetricsreportsacceptedpersecond:" + str(obj.QMSAgent003Numberofmetricsreportsacceptedpersecond))
	if obj.QMSAgent004Numberofrejectedmetricsreports != None:
		print("QMSAgent004Numberofrejectedmetricsreports:" + str(obj.QMSAgent004Numberofrejectedmetricsreports))
	if obj.QMSAgent005Numberofmetricsreportsrejectedpersecond != None:
		print("QMSAgent005Numberofmetricsreportsrejectedpersecond:" + str(obj.QMSAgent005Numberofmetricsreportsrejectedpersecond))
	if obj.QMSAgent006Numberofreportsthatfailedvalidationchecks != None:
		print("QMSAgent006Numberofreportsthatfailedvalidationchecks:" + str(obj.QMSAgent006Numberofreportsthatfailedvalidationchecks))
	if obj.QMSAgent007Numberofservererrorsoccurringduringreportprocessing != None:
		print("QMSAgent007Numberofservererrorsoccurringduringreportprocessing:" + str(obj.QMSAgent007Numberofservererrorsoccurringduringreportprocessing))
	if obj.QMSAgent008TotalnumberofreportsdroppedbecauseMonitoringServerwasnotenabled != None:
		print("QMSAgent008TotalnumberofreportsdroppedbecauseMonitoringServerwasnotenabled:" + str(obj.QMSAgent008TotalnumberofreportsdroppedbecauseMonitoringServerwasnotenabled))
	if obj.QMSAgent009TotalnumberofMSMQmessagessent != None:
		print("QMSAgent009TotalnumberofMSMQmessagessent:" + str(obj.QMSAgent009TotalnumberofMSMQmessagessent))
	if obj.QMSAgent010Numberofmessagequeuemessagessentpersecond != None:
		print("QMSAgent010Numberofmessagequeuemessagessentpersecond:" + str(obj.QMSAgent010Numberofmessagequeuemessagessentpersecond))
	if obj.QMSAgent011Numberofmessagequeuemessagesthatcouldnotbesent != None:
		print("QMSAgent011Numberofmessagequeuemessagesthatcouldnotbesent:" + str(obj.QMSAgent011Numberofmessagequeuemessagesthatcouldnotbesent))
	if obj.QMSAgent012NumberoffailedTLSconnectionattempts != None:
		print("QMSAgent012NumberoffailedTLSconnectionattempts:" + str(obj.QMSAgent012NumberoffailedTLSconnectionattempts))
	if obj.QMSAgent013Totalnumberofmetricsreportsacceptedbytheexternalreportconsumer != None:
		print("QMSAgent013Totalnumberofmetricsreportsacceptedbytheexternalreportconsumer:" + str(obj.QMSAgent013Totalnumberofmetricsreportsacceptedbytheexternalreportconsumer))
	if obj.QMSAgent014Totalnumberofmetricsreportsrejectedbytheexternalreportconsumer != None:
		print("QMSAgent014Totalnumberofmetricsreportsrejectedbytheexternalreportconsumer:" + str(obj.QMSAgent014Totalnumberofmetricsreportsrejectedbytheexternalreportconsumer))
	if obj.QMSAgent015Totalnumberoffailuresoccurredwhilesendingreportstotheexternalreportconsumer != None:
		print("QMSAgent015Totalnumberoffailuresoccurredwhilesendingreportstotheexternalreportconsumer:" + str(obj.QMSAgent015Totalnumberoffailuresoccurredwhilesendingreportstotheexternalreportconsumer))
	if obj.QMSAgent016Totalnumberofreportsthatcouldnotbesenttotheexternalreportconsumer != None:
		print("QMSAgent016Totalnumberofreportsthatcouldnotbesenttotheexternalreportconsumer:" + str(obj.QMSAgent016Totalnumberofreportsthatcouldnotbesenttotheexternalreportconsumer))
	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))
	print("")
	print("########")
	print("")