Improve log message

This commit is contained in:
nicolargo 2020-12-24 09:49:45 +01:00
parent 80d5479466
commit 6ce88cffd3
2 changed files with 9 additions and 5 deletions

View File

@ -48,6 +48,9 @@ Note: if you want to use SSL, please set 'protocol=https'.
InfluxDB v2 (from InfluxDB v1.8.x/Flux and InfluxDB v2.x)
---------------------------------------------------------
Note: The InfluxDB v2 client (https://pypi.org/project/influxdb-client/)
is only available for Python 3.6 or higher.
The connection should be defined in the Glances configuration file as
following:

View File

@ -73,16 +73,17 @@ class Export(GlancesExport):
logger.critical("Cannot connect to InfluxDB server '%s' (%s)" % (url, e))
sys.exit(2)
else:
logger.info("Connected to InfluxDB server ({})".format(client.health()))
logger.info("Connected to InfluxDB server version {} ({})".format(client.health().version,
client.health().message))
# Create the write client
write_client = client.write_api(write_options=WriteOptions(batch_size=500,
flush_interval=10_000,
jitter_interval=2_000,
retry_interval=5_000,
flush_interval=10000,
jitter_interval=2000,
retry_interval=5000,
max_retries=5,
max_retry_delay=30_000,
max_retry_delay=30000,
exponential_base=2))
return write_client