Browser do not working

This commit is contained in:
nicolargo 2024-12-30 14:19:26 +01:00
parent 825b9879c8
commit 5274339774
7 changed files with 8 additions and 11 deletions

View File

@ -112,7 +112,7 @@ Optional dependencies:
- ``influxdb-client`` (for the InfluxDB version 2 export module)
- ``jinja2`` (for templating, used under the hood by FastAPI)
- ``kafka-python`` (for the Kafka export module)
- ``netifaces-plus`` (for the IP plugin)
- ``netifaces2`` (for the IP plugin)
- ``nvidia-ml-py`` (for the GPU plugin)
- ``pycouchdb`` (for the CouchDB export module)
- ``pika`` (for the RabbitMQ/ActiveMQ export module)

View File

@ -9,10 +9,7 @@
# WARNING: the Alpine image version and Python version should be set.
# Alpine 3.18 tag is a link to the latest 3.18.x version.
# Be aware that if you change the Alpine version, you may have to change the Python version.
# Netifaces (and Netifaces-plus) are not compliant with GCC embeded in Alpine 3.21
# See: https://github.com/tsukumijima/netifaces-plus/issues/9
ARG IMAGE_VERSION=3.20
ARG IMAGE_VERSION=3.21
ARG PYTHON_VERSION=3.12
##############################################################################

View File

@ -88,7 +88,7 @@ class PluginModel(GlancesPluginModel):
def get_private_ip(self, stats, stop=False):
# Get the default gateway thanks to the netifaces lib
try:
default_gw = netifaces.gateways()['default'][netifaces.AF_INET]
default_gw = netifaces.gateways()[netifaces.AF_INET][0]
except (KeyError, AttributeError) as e:
logger.debug(f"Cannot grab default gateway IP address ({e})")
stop = True
@ -99,7 +99,7 @@ class PluginModel(GlancesPluginModel):
def get_first_ip(self, stats, stop=False):
try:
default_gw = netifaces.gateways()['default'][netifaces.AF_INET]
default_gw = netifaces.gateways()[netifaces.AF_INET][0]
address = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['addr']
mask = netifaces.ifaddresses(default_gw[1])[netifaces.AF_INET][0]['netmask']
except (KeyError, AttributeError) as e:

View File

@ -50,7 +50,7 @@ class GlancesPortsList:
if default_gateway.lower().startswith('true') and netifaces_tag:
new_port = {}
try:
new_port['host'] = netifaces.gateways()['default'][netifaces.AF_INET][0]
new_port['host'] = netifaces.gateways()[netifaces.AF_INET][0][0]
except KeyError:
new_port['host'] = None
# ICMP

View File

@ -244,7 +244,7 @@ class GlancesAutoDiscoverClient:
import netifaces
# Interface of the default gateway
gateway_itf = netifaces.gateways()['default'][netifaces.AF_INET][1]
gateway_itf = netifaces.gateways()[netifaces.AF_INET][0][1]
# IP address for the interface
return netifaces.ifaddresses(gateway_itf)[netifaces.AF_INET][0]['addr']

View File

@ -14,7 +14,7 @@ influxdb>=1.0.0 # For InfluxDB < 1.8
influxdb-client # For InfluxDB >= 1.8
jinja2
kafka-python
netifaces-plus
netifaces2
nvidia-ml-py
orjson
paho-mqtt

View File

@ -84,7 +84,7 @@ export = [
]
gpu = ["nvidia-ml-py"]
graph = ["pygal"]
ip = ["netifaces-plus"]
ip = ["netifaces2"]
raid = ["pymdstat"]
sensors = ["batinfo; platform_system == 'Linux'"]
smart = ["pySMART.smartx"]