diff options
-rw-r--r-- | conf/glances.conf | 2 | ||||
-rw-r--r-- | glances/exports/glances_mqtt.py | 5 |
2 files changed, 3 insertions, 4 deletions
diff --git a/conf/glances.conf b/conf/glances.conf index b09d1475..ab63f527 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -547,7 +547,7 @@ queue=glances_queue # Configuration for the --export mqtt option host=localhost port=1883 -tls=true +tls=false user=guest password=guest topic=glances diff --git a/glances/exports/glances_mqtt.py b/glances/exports/glances_mqtt.py index a6582a32..0f3d3587 100644 --- a/glances/exports/glances_mqtt.py +++ b/glances/exports/glances_mqtt.py @@ -45,7 +45,6 @@ class Export(GlancesExport): # Get the current hostname self.hostname = socket.gethostname() - self.port = int(self.port) or 8883 self.topic = self.topic or 'glances' self.user = self.user or 'glances' @@ -59,7 +58,7 @@ class Export(GlancesExport): # Init the MQTT client self.client = self.init() if not self.client: - exit('MQTT client initialization failed') + exit("MQTT client initialization failed") def init(self): """Init the connection to the MQTT server.""" @@ -74,7 +73,7 @@ class Export(GlancesExport): client.loop_start() return client except Exception as e: - logger.critical("Connection to MQTT server failed : %s " % e) + logger.critical("Connection to MQTT server %s:%s failed with error: %s " % (self.host, self.port, e)) return None def export(self, name, columns, points): |