From 4806ffd2ae16c2304513c3178fe23083afb23945 Mon Sep 17 00:00:00 2001 From: Rogerio Goncalves Date: Mon, 19 Sep 2022 23:13:37 +0100 Subject: [PATCH] proc_stats: expose network packets, errors and drops Signed-off-by: Rogerio Goncalves --- moonraker/components/proc_stats.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/moonraker/components/proc_stats.py b/moonraker/components/proc_stats.py index c4b541f..a12ef4c 100644 --- a/moonraker/components/proc_stats.py +++ b/moonraker/components/proc_stats.py @@ -242,7 +242,13 @@ class ProcStats: parsed_stats = stats.strip().split() net_stats[dev_name] = { 'rx_bytes': int(parsed_stats[0]), - 'tx_bytes': int(parsed_stats[8]) + 'tx_bytes': int(parsed_stats[8]), + 'rx_packets': int(parsed_stats[1]), + 'tx_packets': int(parsed_stats[9]), + 'rx_errs': int(parsed_stats[2]), + 'tx_errs': int(parsed_stats[10]), + 'rx_drop': int(parsed_stats[3]), + 'tx_drop': int(parsed_stats[11]) } return net_stats except Exception: