Contact Info

Crumbtrail

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

Win32_PerfFormattedData_FileReplicaSet 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_PerfFormattedData_FileReplicaSet 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_PerfFormattedData_FileReplicaSet_FileReplicaSet')

for obj in objWMI:
	if obj.Authentications != None:
		print("Authentications:" + str(obj.Authentications))
	if obj.AuthenticationsinError != None:
		print("AuthenticationsinError:" + str(obj.AuthenticationsinError))
	if obj.Bindings != None:
		print("Bindings:" + str(obj.Bindings))
	if obj.BindingsinError != None:
		print("BindingsinError:" + str(obj.BindingsinError))
	if obj.BytesofFilesInstalled != None:
		print("BytesofFilesInstalled:" + str(obj.BytesofFilesInstalled))
	if obj.BytesofStagingFetched != None:
		print("BytesofStagingFetched:" + str(obj.BytesofStagingFetched))
	if obj.BytesofStagingGenerated != None:
		print("BytesofStagingGenerated:" + str(obj.BytesofStagingGenerated))
	if obj.BytesofStagingRegenerated != None:
		print("BytesofStagingRegenerated:" + str(obj.BytesofStagingRegenerated))
	if obj.Caption != None:
		print("Caption:" + str(obj.Caption))
	if obj.ChangeOrdersAborted != None:
		print("ChangeOrdersAborted:" + str(obj.ChangeOrdersAborted))
	if obj.ChangeOrdersEvaporated != None:
		print("ChangeOrdersEvaporated:" + str(obj.ChangeOrdersEvaporated))
	if obj.ChangeOrdersIssued != None:
		print("ChangeOrdersIssued:" + str(obj.ChangeOrdersIssued))
	if obj.ChangeOrdersMorphed != None:
		print("ChangeOrdersMorphed:" + str(obj.ChangeOrdersMorphed))
	if obj.ChangeOrdersPropagated != None:
		print("ChangeOrdersPropagated:" + str(obj.ChangeOrdersPropagated))
	if obj.ChangeOrdersReceived != None:
		print("ChangeOrdersReceived:" + str(obj.ChangeOrdersReceived))
	if obj.ChangeOrdersRetired != None:
		print("ChangeOrdersRetired:" + str(obj.ChangeOrdersRetired))
	if obj.ChangeOrdersRetried != None:
		print("ChangeOrdersRetried:" + str(obj.ChangeOrdersRetried))
	if obj.ChangeOrdersRetriedatFetch != None:
		print("ChangeOrdersRetriedatFetch:" + str(obj.ChangeOrdersRetriedatFetch))
	if obj.ChangeOrdersRetriedatGenerate != None:
		print("ChangeOrdersRetriedatGenerate:" + str(obj.ChangeOrdersRetriedatGenerate))
	if obj.ChangeOrdersRetriedatInstall != None:
		print("ChangeOrdersRetriedatInstall:" + str(obj.ChangeOrdersRetriedatInstall))
	if obj.ChangeOrdersRetriedatRename != None:
		print("ChangeOrdersRetriedatRename:" + str(obj.ChangeOrdersRetriedatRename))
	if obj.ChangeOrdersSent != None:
		print("ChangeOrdersSent:" + str(obj.ChangeOrdersSent))
	if obj.CommunicationTimeouts != None:
		print("CommunicationTimeouts:" + str(obj.CommunicationTimeouts))
	if obj.Description != None:
		print("Description:" + str(obj.Description))
	if obj.DSBindings != None:
		print("DSBindings:" + str(obj.DSBindings))
	if obj.DSBindingsinError != None:
		print("DSBindingsinError:" + str(obj.DSBindingsinError))
	if obj.DSObjects != None:
		print("DSObjects:" + str(obj.DSObjects))
	if obj.DSObjectsinError != None:
		print("DSObjectsinError:" + str(obj.DSObjectsinError))
	if obj.DSPolls != None:
		print("DSPolls:" + str(obj.DSPolls))
	if obj.DSPollswithChanges != None:
		print("DSPollswithChanges:" + str(obj.DSPollswithChanges))
	if obj.DSPollswithoutChanges != None:
		print("DSPollswithoutChanges:" + str(obj.DSPollswithoutChanges))
	if obj.DSSearches != None:
		print("DSSearches:" + str(obj.DSSearches))
	if obj.DSSearchesinError != None:
		print("DSSearchesinError:" + str(obj.DSSearchesinError))
	if obj.FetchBlocksReceived != None:
		print("FetchBlocksReceived:" + str(obj.FetchBlocksReceived))
	if obj.FetchBlocksReceivedinBytes != None:
		print("FetchBlocksReceivedinBytes:" + str(obj.FetchBlocksReceivedinBytes))
	if obj.FetchBlocksSent != None:
		print("FetchBlocksSent:" + str(obj.FetchBlocksSent))
	if obj.FetchBlocksSentinBytes != None:
		print("FetchBlocksSentinBytes:" + str(obj.FetchBlocksSentinBytes))
	if obj.FetchRequestsReceived != None:
		print("FetchRequestsReceived:" + str(obj.FetchRequestsReceived))
	if obj.FetchRequestsSent != None:
		print("FetchRequestsSent:" + str(obj.FetchRequestsSent))
	if obj.FilesInstalled != None:
		print("FilesInstalled:" + str(obj.FilesInstalled))
	if obj.FilesInstalledwithError != None:
		print("FilesInstalledwithError:" + str(obj.FilesInstalledwithError))
	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.InboundChangeOrdersDampened != None:
		print("InboundChangeOrdersDampened:" + str(obj.InboundChangeOrdersDampened))
	if obj.JoinNotificationsReceived != None:
		print("JoinNotificationsReceived:" + str(obj.JoinNotificationsReceived))
	if obj.JoinNotificationsSent != None:
		print("JoinNotificationsSent:" + str(obj.JoinNotificationsSent))
	if obj.Joins != None:
		print("Joins:" + str(obj.Joins))
	if obj.KBofStagingSpaceFree != None:
		print("KBofStagingSpaceFree:" + str(obj.KBofStagingSpaceFree))
	if obj.KBofStagingSpaceInUse != None:
		print("KBofStagingSpaceInUse:" + str(obj.KBofStagingSpaceInUse))
	if obj.LocalChangeOrdersAborted != None:
		print("LocalChangeOrdersAborted:" + str(obj.LocalChangeOrdersAborted))
	if obj.LocalChangeOrdersIssued != None:
		print("LocalChangeOrdersIssued:" + str(obj.LocalChangeOrdersIssued))
	if obj.LocalChangeOrdersMorphed != None:
		print("LocalChangeOrdersMorphed:" + str(obj.LocalChangeOrdersMorphed))
	if obj.LocalChangeOrdersPropagated != None:
		print("LocalChangeOrdersPropagated:" + str(obj.LocalChangeOrdersPropagated))
	if obj.LocalChangeOrdersRetired != None:
		print("LocalChangeOrdersRetired:" + str(obj.LocalChangeOrdersRetired))
	if obj.LocalChangeOrdersRetried != None:
		print("LocalChangeOrdersRetried:" + str(obj.LocalChangeOrdersRetried))
	if obj.LocalChangeOrdersRetriedatFetch != None:
		print("LocalChangeOrdersRetriedatFetch:" + str(obj.LocalChangeOrdersRetriedatFetch))
	if obj.LocalChangeOrdersRetriedatGenerate != None:
		print("LocalChangeOrdersRetriedatGenerate:" + str(obj.LocalChangeOrdersRetriedatGenerate))
	if obj.LocalChangeOrdersRetriedatInstall != None:
		print("LocalChangeOrdersRetriedatInstall:" + str(obj.LocalChangeOrdersRetriedatInstall))
	if obj.LocalChangeOrdersRetriedatRename != None:
		print("LocalChangeOrdersRetriedatRename:" + str(obj.LocalChangeOrdersRetriedatRename))
	if obj.LocalChangeOrdersSent != None:
		print("LocalChangeOrdersSent:" + str(obj.LocalChangeOrdersSent))
	if obj.LocalChangeOrdersSentAtJoin != None:
		print("LocalChangeOrdersSentAtJoin:" + str(obj.LocalChangeOrdersSentAtJoin))
	if obj.Name != None:
		print("Name:" + str(obj.Name))
	if obj.OutboundChangeOrdersDampened != None:
		print("OutboundChangeOrdersDampened:" + str(obj.OutboundChangeOrdersDampened))
	if obj.PacketsReceived != None:
		print("PacketsReceived:" + str(obj.PacketsReceived))
	if obj.PacketsReceivedinBytes != None:
		print("PacketsReceivedinBytes:" + str(obj.PacketsReceivedinBytes))
	if obj.PacketsReceivedinError != None:
		print("PacketsReceivedinError:" + str(obj.PacketsReceivedinError))
	if obj.PacketsSent != None:
		print("PacketsSent:" + str(obj.PacketsSent))
	if obj.PacketsSentinBytes != None:
		print("PacketsSentinBytes:" + str(obj.PacketsSentinBytes))
	if obj.PacketsSentinError != None:
		print("PacketsSentinError:" + str(obj.PacketsSentinError))
	if obj.RemoteChangeOrdersAborted != None:
		print("RemoteChangeOrdersAborted:" + str(obj.RemoteChangeOrdersAborted))
	if obj.RemoteChangeOrdersIssued != None:
		print("RemoteChangeOrdersIssued:" + str(obj.RemoteChangeOrdersIssued))
	if obj.RemoteChangeOrdersMorphed != None:
		print("RemoteChangeOrdersMorphed:" + str(obj.RemoteChangeOrdersMorphed))
	if obj.RemoteChangeOrdersPropagated != None:
		print("RemoteChangeOrdersPropagated:" + str(obj.RemoteChangeOrdersPropagated))
	if obj.RemoteChangeOrdersReceived != None:
		print("RemoteChangeOrdersReceived:" + str(obj.RemoteChangeOrdersReceived))
	if obj.RemoteChangeOrdersRetired != None:
		print("RemoteChangeOrdersRetired:" + str(obj.RemoteChangeOrdersRetired))
	if obj.RemoteChangeOrdersRetried != None:
		print("RemoteChangeOrdersRetried:" + str(obj.RemoteChangeOrdersRetried))
	if obj.RemoteChangeOrdersRetriedatFetch != None:
		print("RemoteChangeOrdersRetriedatFetch:" + str(obj.RemoteChangeOrdersRetriedatFetch))
	if obj.RemoteChangeOrdersRetriedatGenerate != None:
		print("RemoteChangeOrdersRetriedatGenerate:" + str(obj.RemoteChangeOrdersRetriedatGenerate))
	if obj.RemoteChangeOrdersRetriedatInstall != None:
		print("RemoteChangeOrdersRetriedatInstall:" + str(obj.RemoteChangeOrdersRetriedatInstall))
	if obj.RemoteChangeOrdersRetriedatRename != None:
		print("RemoteChangeOrdersRetriedatRename:" + str(obj.RemoteChangeOrdersRetriedatRename))
	if obj.RemoteChangeOrdersSent != None:
		print("RemoteChangeOrdersSent:" + str(obj.RemoteChangeOrdersSent))
	if obj.ReplicaSetsCreated != None:
		print("ReplicaSetsCreated:" + str(obj.ReplicaSetsCreated))
	if obj.ReplicaSetsDeleted != None:
		print("ReplicaSetsDeleted:" + str(obj.ReplicaSetsDeleted))
	if obj.ReplicaSetsRemoved != None:
		print("ReplicaSetsRemoved:" + str(obj.ReplicaSetsRemoved))
	if obj.ReplicaSetsStarted != None:
		print("ReplicaSetsStarted:" + str(obj.ReplicaSetsStarted))
	if obj.StagingFilesFetched != None:
		print("StagingFilesFetched:" + str(obj.StagingFilesFetched))
	if obj.StagingFilesGenerated != None:
		print("StagingFilesGenerated:" + str(obj.StagingFilesGenerated))
	if obj.StagingFilesGeneratedwithError != None:
		print("StagingFilesGeneratedwithError:" + str(obj.StagingFilesGeneratedwithError))
	if obj.StagingFilesRegenerated != None:
		print("StagingFilesRegenerated:" + str(obj.StagingFilesRegenerated))
	if obj.Threadsexited != None:
		print("Threadsexited:" + str(obj.Threadsexited))
	if obj.Threadsstarted != None:
		print("Threadsstarted:" + str(obj.Threadsstarted))
	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.Unjoins != None:
		print("Unjoins:" + str(obj.Unjoins))
	if obj.UsnReads != None:
		print("UsnReads:" + str(obj.UsnReads))
	if obj.UsnRecordsAccepted != None:
		print("UsnRecordsAccepted:" + str(obj.UsnRecordsAccepted))
	if obj.UsnRecordsExamined != None:
		print("UsnRecordsExamined:" + str(obj.UsnRecordsExamined))
	if obj.UsnRecordsRejected != None:
		print("UsnRecordsRejected:" + str(obj.UsnRecordsRejected))
	print("")
	print("########")
	print("")