mirror of
https://github.com/nicolargo/glances.git
synced 2026-09-21 01:32:23 -04:00
_get_network_stats() read the container network counters from a single hardcoded interface. The Docker stats endpoint returns one entry per container interface, so a container attached to several networks gets eth0, eth1... and everything past eth0 was silently dropped, making the reported RX/TX rates too low. Sum rx_bytes/tx_bytes across all the interfaces instead. Loopback is excluded, since Docker-API-compatible runtimes have been observed to report it and its traffic would inflate the totals. Interfaces with missing counters are skipped rather than aborting the whole method, so one malformed interface no longer discards the valid ones. None is still returned when nothing usable remains, keeping --network host containers unchanged. The output contract is untouched: same keys, same types, same units. Fixes #3669