From d264155fc295ee3bafa71c8c8d1a74d6cd909d6a Mon Sep 17 00:00:00 2001 From: nicolargo Date: Sat, 4 Jan 2025 11:20:08 +0100 Subject: [PATCH] Add a message to verify Netifaces2 --- glances/plugins/ip/__init__.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/glances/plugins/ip/__init__.py b/glances/plugins/ip/__init__.py index ccf01096..e5cbbb7a 100644 --- a/glances/plugins/ip/__init__.py +++ b/glances/plugins/ip/__init__.py @@ -24,6 +24,15 @@ except ImportError as e: else: import_error_tag = False +try: + netifaces.default_gateway() +except Exception: + import_error_tag = True + logger.warning("Netifaces2 should be installed in your Python environment, IP plugin is disabled") +else: + import_error_tag = False + + # Fields description # description: human readable description # short_name: shortname to use un UI