Closed njam closed 8 years ago
While researching about this topic, I came across some other methods to gather network errors..
e.g.
# bulldog4 (em1 main NIC)
$ ls /sys/class/net/em1/statistics
collisions rx_dropped rx_missed_errors tx_carrier_errors tx_heartbeat_errors
multicast rx_errors rx_over_errors tx_compressed tx_packets
rx_bytes rx_fifo_errors rx_packets tx_dropped tx_window_errors
rx_compressed rx_frame_errors tx_aborted_errors tx_errors
rx_crc_errors rx_length_errors tx_bytes tx_fifo_errors
# janus5
$ ls /sys/class/net/eth4/statistics/
collisions rx_crc_errors rx_frame_errors rx_packets tx_compressed tx_heartbeat_errors
multicast rx_dropped rx_length_errors tx_aborted_errors tx_dropped tx_packets
rx_bytes rx_errors rx_missed_errors tx_bytes tx_errors tx_window_errors
rx_compressed rx_fifo_errors rx_over_errors tx_carrier_errors tx_fifo_errors
These values depend on the network card driver being loaded and used. (Needs ethtool
to find out)
E.g.
# on bulldog:
$ ethtool -i em1
driver: tg3
version: 3.137
firmware-version: 5719-v1.41 NCSI v1.3.7.0
bus-info: 0000:02:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
# on janus5 (10Gbit)
$ ethtool -i eth4
driver: ixgbe
version: 3.19.1-k
firmware-version: 0x80000208
bus-info: 0000:81:00.0
supports-statistics: yes
supports-test: yes
supports-eeprom-access: yes
supports-register-dump: yes
supports-priv-flags: no
Am I right to think that we're interested in:
Also, there is this:
$ cat /proc/net/snmp | grep Udp:
Udp: InDatagrams NoPorts InErrors OutDatagrams RcvbufErrors SndbufErrors InCsumErrors
Udp: 483476138 415872 201069 3355572970 201068 0 1
which would yield RcvbufErrors
and SndbufErrors
even when their value is 0
let's wait for CI @njam please review
As discussed let's iterate over all interfaces and sum up statistics.
To be excluded:
~$ cat /sys/class/net/{bond0,eth0}/statistics/tx_packets
473150133
473150133
vboxnet0
May be make the interfaces to be excluded configurable per regex?
@njam please review
Agree it looks much better now, @njam please review
metrics
data
@njam true, now?
Generally we try to add doc-blocks to all functions, it helps with refactoring. In bipbip it's not done in many places yet.
makes sense, @njam please review
lgtm! please remove the dashboard before releasing
E.g.
SndbufErrors
andRcvbufErrors
. They only show up if present.(this output might be different for different "netstat" versions!)
Maybe also relevant:
Some input: http://blog.packagecloud.io/eng/2016/06/22/monitoring-tuning-linux-networking-stack-receiving-data/#monitoring-network-devices