diff options
Diffstat (limited to 'glances/exports/glances_mqtt.py')
-rw-r--r-- | glances/exports/glances_mqtt.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/glances/exports/glances_mqtt.py b/glances/exports/glances_mqtt.py index 017e33c8..122113e7 100644 --- a/glances/exports/glances_mqtt.py +++ b/glances/exports/glances_mqtt.py @@ -2,7 +2,7 @@ # # This file is part of Glances. # -# Copyright (C) 2018 Nicolargo <nicolas@nicolargo.com> +# Copyright (C) 2019 Nicolargo <nicolas@nicolargo.com> # # Glances is free software; you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by @@ -92,7 +92,10 @@ class Export(GlancesExport): for sensor, value in zip(columns, points): try: sensor = [whitelisted(name) for name in sensor.split('.')] - topic = '/'.join([self.topic, self.hostname, name, *sensor]) + tobeexport = [self.topic, self.hostname, name] + tobeexport.extend(sensor) + topic = '/'.join(tobeexport) + self.client.publish(topic, value) except Exception as e: logger.error("Can not export stats to MQTT server (%s)" % e) |