def get_net_bytes(dev='eth0'):
    """Read network interface traffic counters"""
    return {
        'rx': float(open('/sys/class/net/%s/statistics/rx_bytes' % dev,'r').read().strip()),
        'tx': float(open('/sys/class/net/%s/statistics/tx_bytes' % dev,'r').read().strip())
    }