From 22db708dcebc367881841811fc3b8212d3e4bfc4 Mon Sep 17 00:00:00 2001 From: nicolargo Date: Tue, 6 Nov 2018 21:08:49 +0100 Subject: [PATCH] KeyError: 'eth0' when interface is not connected #1348 --- glances/plugins/glances_network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/glances/plugins/glances_network.py b/glances/plugins/glances_network.py index b51b4d26..a7e31fd9 100644 --- a/glances/plugins/glances_network.py +++ b/glances/plugins/glances_network.py @@ -108,7 +108,8 @@ class Plugin(GlancesPlugin): network_new = netiocounters for net in network_new: # Do not take hidden interface into account - if self.is_hide(net): + # or KeyError: 'eth0' when interface is not connected #1348 + if self.is_hide(net) or net not in netstatus: continue try: cumulative_rx = network_new[net].bytes_recv -- GitLab