Contact Info

Crumbtrail

ActiveXperts.com » Administration » Scripts » WMI Performance Counters » Python

MEDIA02Informational - WMI sample in Python

The foundations for Manageability in Windows 2019/2012/2008/ and Windows 10/8/7/Vista/XP are 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.

On this site, you can find many WMI samples.

The MEDIA02Informational WMI class can be used in ActiveXperts Network Monitor to monitor your servers.


MEDIA02Informational

Example(s)

from win32com.client import GetObject
objWMI = GetObject('winmgmts:').InstancesOf('Win32_PerfRawData_MediaPerf_MEDIA02Informational')

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.MEDIA000Numberofsendonlyaudiochannelsstarted != None:
		print("MEDIA000Numberofsendonlyaudiochannelsstarted:" + str(obj.MEDIA000Numberofsendonlyaudiochannelsstarted))
	if obj.MEDIA001Numberofreceiveonlyaudiochannelsstarted != None:
		print("MEDIA001Numberofreceiveonlyaudiochannelsstarted:" + str(obj.MEDIA001Numberofreceiveonlyaudiochannelsstarted))
	if obj.MEDIA002Numberofsendreceiveaudiochannelsstarted != None:
		print("MEDIA002Numberofsendreceiveaudiochannelsstarted:" + str(obj.MEDIA002Numberofsendreceiveaudiochannelsstarted))
	if obj.MEDIA003Numberofsendonlyvideochannelsstarted != None:
		print("MEDIA003Numberofsendonlyvideochannelsstarted:" + str(obj.MEDIA003Numberofsendonlyvideochannelsstarted))
	if obj.MEDIA004Numberofreceiveonlyvideochannelsstarted != None:
		print("MEDIA004Numberofreceiveonlyvideochannelsstarted:" + str(obj.MEDIA004Numberofreceiveonlyvideochannelsstarted))
	if obj.MEDIA005Numberofsendreceivevideochannelsstarted != None:
		print("MEDIA005Numberofsendreceivevideochannelsstarted:" + str(obj.MEDIA005Numberofsendreceivevideochannelsstarted))
	if obj.MEDIA006Averagetimespentinprocessingaudiopackets != None:
		print("MEDIA006Averagetimespentinprocessingaudiopackets:" + str(obj.MEDIA006Averagetimespentinprocessingaudiopackets))
	if obj.MEDIA006Averagetimespentinprocessingaudiopackets_Base != None:
		print("MEDIA006Averagetimespentinprocessingaudiopackets_Base:" + str(obj.MEDIA006Averagetimespentinprocessingaudiopackets_Base))
	if obj.MEDIA008TimerticksPersec != None:
		print("MEDIA008TimerticksPersec:" + str(obj.MEDIA008TimerticksPersec))
	if obj.MEDIA009Conferenceprocessrate != None:
		print("MEDIA009Conferenceprocessrate:" + str(obj.MEDIA009Conferenceprocessrate))
	if obj.MEDIA010AverageICEAddressBindingTime != None:
		print("MEDIA010AverageICEAddressBindingTime:" + str(obj.MEDIA010AverageICEAddressBindingTime))
	if obj.MEDIA010AverageICEAddressBindingTime_Base != None:
		print("MEDIA010AverageICEAddressBindingTime_Base:" + str(obj.MEDIA010AverageICEAddressBindingTime_Base))
	if obj.MEDIA012AverageICEConnectivityCheckTime != None:
		print("MEDIA012AverageICEConnectivityCheckTime:" + str(obj.MEDIA012AverageICEConnectivityCheckTime))
	if obj.MEDIA012AverageICEConnectivityCheckTime_Base != None:
		print("MEDIA012AverageICEConnectivityCheckTime_Base:" + str(obj.MEDIA012AverageICEConnectivityCheckTime_Base))
	if obj.MEDIA014AudiopacketsreceivedfromtransportproviderPersec != None:
		print("MEDIA014AudiopacketsreceivedfromtransportproviderPersec:" + str(obj.MEDIA014AudiopacketsreceivedfromtransportproviderPersec))
	if obj.MEDIA015AudiopacketsreceivedfromRTPlayerPersec != None:
		print("MEDIA015AudiopacketsreceivedfromRTPlayerPersec:" + str(obj.MEDIA015AudiopacketsreceivedfromRTPlayerPersec))
	if obj.MEDIA016AudiopacketsreceivedfromaudioenginePersec != None:
		print("MEDIA016AudiopacketsreceivedfromaudioenginePersec:" + str(obj.MEDIA016AudiopacketsreceivedfromaudioenginePersec))
	if obj.MEDIA017AudiopacketssentintoaudioenginePersec != None:
		print("MEDIA017AudiopacketssentintoaudioenginePersec:" + str(obj.MEDIA017AudiopacketssentintoaudioenginePersec))
	if obj.MEDIA018AudiorouterinputbuffersPersec != None:
		print("MEDIA018AudiorouterinputbuffersPersec:" + str(obj.MEDIA018AudiorouterinputbuffersPersec))
	if obj.MEDIA019AudiorouteroutputbuffersPersec != None:
		print("MEDIA019AudiorouteroutputbuffersPersec:" + str(obj.MEDIA019AudiorouteroutputbuffersPersec))
	if obj.MEDIA020AudiopacketssenttoRTPPersec != None:
		print("MEDIA020AudiopacketssenttoRTPPersec:" + str(obj.MEDIA020AudiopacketssenttoRTPPersec))
	if obj.MEDIA021AudiopacketssenttotransportproviderPersec != None:
		print("MEDIA021AudiopacketssenttotransportproviderPersec:" + str(obj.MEDIA021AudiopacketssenttotransportproviderPersec))
	if obj.MEDIA022VideopacketsreceivedfromtransportproviderPersec != None:
		print("MEDIA022VideopacketsreceivedfromtransportproviderPersec:" + str(obj.MEDIA022VideopacketsreceivedfromtransportproviderPersec))
	if obj.MEDIA023VideopacketsreceivedfromRTPPersec != None:
		print("MEDIA023VideopacketsreceivedfromRTPPersec:" + str(obj.MEDIA023VideopacketsreceivedfromRTPPersec))
	if obj.MEDIA024VideoframereceivedfromusersPersec != None:
		print("MEDIA024VideoframereceivedfromusersPersec:" + str(obj.MEDIA024VideoframereceivedfromusersPersec))
	if obj.MEDIA025VideopacketssenttovideoenginePersec != None:
		print("MEDIA025VideopacketssenttovideoenginePersec:" + str(obj.MEDIA025VideopacketssenttovideoenginePersec))
	if obj.MEDIA026VideopacketssenttoRTPPersec != None:
		print("MEDIA026VideopacketssenttoRTPPersec:" + str(obj.MEDIA026VideopacketssenttoRTPPersec))
	if obj.MEDIA027VideopacketssenttotransportproviderPersec != None:
		print("MEDIA027VideopacketssenttotransportproviderPersec:" + str(obj.MEDIA027VideopacketssenttotransportproviderPersec))
	if obj.MEDIA028VideoswitcherinputframesPersec != None:
		print("MEDIA028VideoswitcherinputframesPersec:" + str(obj.MEDIA028VideoswitcherinputframesPersec))
	if obj.MEDIA029VideoswitcheroutputframesPersec != None:
		print("MEDIA029VideoswitcheroutputframesPersec:" + str(obj.MEDIA029VideoswitcheroutputframesPersec))
	if obj.MEDIA030DatapacketsreceivedfromtransportproviderPersec != None:
		print("MEDIA030DatapacketsreceivedfromtransportproviderPersec:" + str(obj.MEDIA030DatapacketsreceivedfromtransportproviderPersec))
	if obj.MEDIA031DatapacketssenttotransportproviderPersec != None:
		print("MEDIA031DatapacketssenttotransportproviderPersec:" + str(obj.MEDIA031DatapacketssenttotransportproviderPersec))
	if obj.MEDIA032Thenumberoftimesdatachannelisstalled != None:
		print("MEDIA032Thenumberoftimesdatachannelisstalled:" + str(obj.MEDIA032Thenumberoftimesdatachannelisstalled))
	if obj.MEDIA033Thenumberoftimesdatachanneltransportisstalled != None:
		print("MEDIA033Thenumberoftimesdatachanneltransportisstalled:" + str(obj.MEDIA033Thenumberoftimesdatachanneltransportisstalled))
	if obj.MEDIA034PacketsproducedbytheTCPpacketizerPersec != None:
		print("MEDIA034PacketsproducedbytheTCPpacketizerPersec:" + str(obj.MEDIA034PacketsproducedbytheTCPpacketizerPersec))
	if obj.MEDIA035NumberofsuccessfulreceiveIOPersec != None:
		print("MEDIA035NumberofsuccessfulreceiveIOPersec:" + str(obj.MEDIA035NumberofsuccessfulreceiveIOPersec))
	if obj.MEDIA036NumberofsuccessfulsendIOPersec != None:
		print("MEDIA036NumberofsuccessfulsendIOPersec:" + str(obj.MEDIA036NumberofsuccessfulsendIOPersec))
	if obj.MEDIA037NumberoffailedreceiveIOPersec != None:
		print("MEDIA037NumberoffailedreceiveIOPersec:" + str(obj.MEDIA037NumberoffailedreceiveIOPersec))
	if obj.MEDIA038NumberoffailedsendIOPersec != None:
		print("MEDIA038NumberoffailedsendIOPersec:" + str(obj.MEDIA038NumberoffailedsendIOPersec))
	if obj.MEDIA039RTCPpacketsreceivedPersec != None:
		print("MEDIA039RTCPpacketsreceivedPersec:" + str(obj.MEDIA039RTCPpacketsreceivedPersec))
	if obj.MEDIA040RTCPpacketssentPersec != None:
		print("MEDIA040RTCPpacketssentPersec:" + str(obj.MEDIA040RTCPpacketssentPersec))
	if obj.MEDIA041Heapallocation != None:
		print("MEDIA041Heapallocation:" + str(obj.MEDIA041Heapallocation))
	if obj.MEDIA042Heapfree != None:
		print("MEDIA042Heapfree:" + str(obj.MEDIA042Heapfree))
	if obj.MEDIA043Totalnumberofnetworkbuffers != None:
		print("MEDIA043Totalnumberofnetworkbuffers:" + str(obj.MEDIA043Totalnumberofnetworkbuffers))
	if obj.MEDIA044Totalnumberofstreamingbuffers != None:
		print("MEDIA044Totalnumberofstreamingbuffers:" + str(obj.MEDIA044Totalnumberofstreamingbuffers))
	if obj.MEDIA045Totalnumberofportcollisions != None:
		print("MEDIA045Totalnumberofportcollisions:" + str(obj.MEDIA045Totalnumberofportcollisions))
	if obj.Name != None:
		print("Name:" + str(obj.Name))
	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("")