def getWorkingNetInterfaces(): ret = [] network_ifaces = _statgrab.py_sg_get_network_iface_stats() for i in ifaces: if i['up'] is 1: ret.append(i['interface_name']) return ret
def initNetIfaces(): network_ifaces = _statgrab.py_sg_get_network_iface_stats() for i in network_ifaces: NET_INTERFACES.append(i['interface_name']) for i in NET_INTERFACES: netstats = _statgrab.py_sg_get_network_io_stats() for j in netstats: if j['interface_name'] == i: NET_D[i] = NET_LAST_D[i] = j['rx'] NET_U[i] = NET_LAST_U[i] = j['tx']