summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicolargo <nicolas@nicolargo.com>2021-08-14 11:00:47 +0200
committernicolargo <nicolas@nicolargo.com>2021-08-14 11:00:47 +0200
commitab3f849d0f75991f8d9b84368cb1b169b7ded192 (patch)
tree2f2cf13280629a562691de4effb5c62254ee8630
parentea1812652a1b2e5a4885e4f4c12383bcc5c7eb97 (diff)
Glances don't send hostname (tag) to influxdb2
-rw-r--r--glances/exports/glances_influxdb2.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/glances/exports/glances_influxdb2.py b/glances/exports/glances_influxdb2.py
index 55bae118..87a6c3bc 100644
--- a/glances/exports/glances_influxdb2.py
+++ b/glances/exports/glances_influxdb2.py
@@ -20,6 +20,7 @@
"""InfluxDB (from to InfluxDB 1.8+) interface class."""
import sys
+from platform import node
from glances.logger import logger
from glances.exports.glances_export import GlancesExport
@@ -56,6 +57,9 @@ class Export(GlancesExport):
if not self.export_enable:
sys.exit(2)
+ # The hostname is always add as a tag
+ self.hostname = node().split('.')[0]
+
# Init the InfluxDB client
self.client = self.init()