#NEWLINE# def check( self , agentConfig ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# net = w . Win32_PerfFormattedData_Tcpip_NetworkInterface ( ) #NEWLINE# #UNINDENT# except AttributeError : #NEWLINE# #INDENT# self . logger . info ( 'Missing Win32_PerfFormattedData_Tcpip_NetworkInterface WMI class. No network metrics will be returned' ) #NEWLINE# return #NEWLINE# #UNINDENT# for iface in net : #NEWLINE# #INDENT# name = self . normalize_device_name ( iface . name ) #NEWLINE# if ( iface . BytesReceivedPerSec is not None ) : #NEWLINE# #INDENT# self . save_sample ( 'system.net.bytes_rcvd' , iface . BytesReceivedPerSec , device_name = name ) #NEWLINE# #UNINDENT# if ( iface . BytesSentPerSec is not None ) : #NEWLINE# #INDENT# self . save_sample ( 'system.net.bytes_sent' , iface . BytesSentPerSec , device_name = name ) #NEWLINE# #UNINDENT# #UNINDENT# return self . get_metrics ( )