summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/glances.conf2
-rw-r--r--glances/exports/glances_influxdb.py2
-rw-r--r--glances/exports/glances_influxdb2.py2
-rw-r--r--glances/exports/glances_kafka.py2
-rw-r--r--glances/exports/glances_mqtt.py5
-rw-r--r--glances/exports/glances_opentsdb.py2
-rw-r--r--glances/exports/glances_prometheus.py2
-rw-r--r--glances/exports/glances_rabbitmq.py2
-rw-r--r--glances/exports/glances_restful.py2
-rw-r--r--glances/exports/glances_riemann.py2
-rw-r--r--glances/exports/glances_statsd.py2
-rw-r--r--glances/exports/glances_zeromq.py2
12 files changed, 15 insertions, 12 deletions
diff --git a/conf/glances.conf b/conf/glances.conf
index 1d9ce3e0..b09d1475 100644
--- a/conf/glances.conf
+++ b/conf/glances.conf
@@ -546,7 +546,7 @@ queue=glances_queue
[mqtt]
# Configuration for the --export mqtt option
host=localhost
-port=8883
+port=1883
tls=true
user=guest
password=guest
diff --git a/glances/exports/glances_influxdb.py b/glances/exports/glances_influxdb.py
index 3568419e..ffffbc48 100644
--- a/glances/exports/glances_influxdb.py
+++ b/glances/exports/glances_influxdb.py
@@ -42,7 +42,7 @@ class Export(GlancesExport):
'influxdb', mandatories=['host', 'port', 'user', 'password', 'db'], options=['protocol', 'prefix', 'tags']
)
if not self.export_enable:
- sys.exit(2)
+ exit('Missing INFLUXDB version 1 config')
# The hostname is always add as a tag
self.hostname = node().split('.')[0]
diff --git a/glances/exports/glances_influxdb2.py b/glances/exports/glances_influxdb2.py
index de3931c7..ab717227 100644
--- a/glances/exports/glances_influxdb2.py
+++ b/glances/exports/glances_influxdb2.py
@@ -43,7 +43,7 @@ class Export(GlancesExport):
options=['protocol', 'prefix', 'tags'],
)
if not self.export_enable:
- sys.exit(2)
+ exit('Missing INFLUXDB version 1 config')
# The hostname is always add as a tag
self.hostname = node().split('.')[0]
diff --git a/glances/exports/glances_kafka.py b/glances/exports/glances_kafka.py
index d228a138..936d4bff 100644
--- a/glances/exports/glances_kafka.py
+++ b/glances/exports/glances_kafka.py
@@ -40,7 +40,7 @@ class Export(GlancesExport):
'kafka', mandatories=['host', 'port', 'topic'], options=['compression', 'tags']
)
if not self.export_enable:
- sys.exit(2)
+ exit('Missing KAFKA config')
# Init the kafka client
self.client = self.init()
diff --git a/glances/exports/glances_mqtt.py b/glances/exports/glances_mqtt.py
index e4bf0c06..a6582a32 100644
--- a/glances/exports/glances_mqtt.py
+++ b/glances/exports/glances_mqtt.py
@@ -12,6 +12,7 @@
import socket
import string
import json
+import sys
from glances.logger import logger
from glances.exports.glances_export import GlancesExport
@@ -53,10 +54,12 @@ class Export(GlancesExport):
self.topic_structure = (self.topic_structure or 'per-metric').lower()
if self.topic_structure not in ['per-metric', 'per-plugin']:
logger.critical("topic_structure must be either 'per-metric' or 'per-plugin'.")
- return None
+ sys.exit(2)
# Init the MQTT client
self.client = self.init()
+ if not self.client:
+ exit('MQTT client initialization failed')
def init(self):
"""Init the connection to the MQTT server."""
diff --git a/glances/exports/glances_opentsdb.py b/glances/exports/glances_opentsdb.py
index fc3478d1..dbfd1d71 100644
--- a/glances/exports/glances_opentsdb.py
+++ b/glances/exports/glances_opentsdb.py
@@ -37,7 +37,7 @@ class Export(GlancesExport):
# Load the configuration file
self.export_enable = self.load_conf('opentsdb', mandatories=['host', 'port'], options=['prefix', 'tags'])
if not self.export_enable:
- sys.exit(2)
+ exit('Missing OPENTSDB config')
# Default prefix for stats is 'glances'
if self.prefix is None:
diff --git a/glances/exports/glances_prometheus.py b/glances/exports/glances_prometheus.py
index fed2e4a1..629e8a09 100644
--- a/glances/exports/glances_prometheus.py
+++ b/glances/exports/glances_prometheus.py
@@ -32,7 +32,7 @@ class Export(GlancesExport):
# Load the Prometheus configuration file section
self.export_enable = self.load_conf('prometheus', mandatories=['host', 'port', 'labels'], options=['prefix'])
if not self.export_enable:
- sys.exit(2)
+ exit('Missing PROMETHEUS config')
# Optionals configuration keys
if self.prefix is None:
diff --git a/glances/exports/glances_rabbitmq.py b/glances/exports/glances_rabbitmq.py
index 5c2988f5..fa2e3724 100644
--- a/glances/exports/glances_rabbitmq.py
+++ b/glances/exports/glances_rabbitmq.py
@@ -44,7 +44,7 @@ class Export(GlancesExport):
'rabbitmq', mandatories=['host', 'port', 'user', 'password', 'queue'], options=['protocol']
)
if not self.export_enable:
- sys.exit(2)
+ exit('Missing RABBITMQ config')
# Get the current hostname
self.hostname = socket.gethostname()
diff --git a/glances/exports/glances_restful.py b/glances/exports/glances_restful.py
index ed8f3d66..f9fae506 100644
--- a/glances/exports/glances_restful.py
+++ b/glances/exports/glances_restful.py
@@ -34,7 +34,7 @@ class Export(GlancesExport):
# Load the RESTful section in the configuration file
self.export_enable = self.load_conf('restful', mandatories=['host', 'port', 'protocol', 'path'])
if not self.export_enable:
- sys.exit(2)
+ exit('Missing RESTFUL config')
# Init the stats buffer
# It's a dict of stats
diff --git a/glances/exports/glances_riemann.py b/glances/exports/glances_riemann.py
index 5978ceea..b500b829 100644
--- a/glances/exports/glances_riemann.py
+++ b/glances/exports/glances_riemann.py
@@ -38,7 +38,7 @@ class Export(GlancesExport):
# Load the Riemann configuration
self.export_enable = self.load_conf('riemann', mandatories=['host', 'port'], options=[])
if not self.export_enable:
- sys.exit(2)
+ exit('Missing RIEMANN config')
# Get the current hostname
self.hostname = socket.gethostname()
diff --git a/glances/exports/glances_statsd.py b/glances/exports/glances_statsd.py
index fef8f27a..ba65bd82 100644
--- a/glances/exports/glances_statsd.py
+++ b/glances/exports/glances_statsd.py
@@ -36,7 +36,7 @@ class Export(GlancesExport):
# Load the configuration file
self.export_enable = self.load_conf('statsd', mandatories=['host', 'port'], options=['prefix'])
if not self.export_enable:
- sys.exit(2)
+ exit('Missing STATSD config')
# Default prefix for stats is 'glances'
if self.prefix is None:
diff --git a/glances/exports/glances_zeromq.py b/glances/exports/glances_zeromq.py
index daaabf4f..0f2fa310 100644
--- a/glances/exports/glances_zeromq.py
+++ b/glances/exports/glances_zeromq.py
@@ -37,7 +37,7 @@ class Export(GlancesExport):
# Load the ZeroMQ configuration file section ([export_zeromq])
self.export_enable = self.load_conf('zeromq', mandatories=['host', 'port', 'prefix'], options=[])
if not self.export_enable:
- sys.exit(2)
+ exit('Missing ZEROMQ config')
# Init the ZeroMQ context
self.context = None