Can't connect to influxdb with https enabled #1497

This commit is contained in:
nicolargo 2019-07-03 22:13:16 +02:00
parent f8e036ee25
commit 78032b2600
5 changed files with 13 additions and 3 deletions

3
NEWS
View File

@ -12,7 +12,8 @@ Enhancements and new features:
* Add authprovider for cassandra export (thanks to @EmilienMottet) #1395
* Curses's browser server list sorting added (thanks to @limfreee) #1396
* ElasticSearch: add date to index, unbreak object push (thanks to @genevera) # 1438
* Performance issue with large folder #1491
* Performance issue with large folder #1491
* Can't connect to influxdb with https enabled #1497
Bugs corrected:

View File

@ -341,6 +341,7 @@ style=DarkStyle
# https://influxdb.com/
host=localhost
port=8086
protocol=http
user=root
password=root
db=glances

View File

@ -12,6 +12,7 @@ following:
[influxdb]
host=localhost
port=8086
protocol=http
user=root
password=root
db=glances
@ -27,6 +28,8 @@ Glances generates a lot of columns, e.g., if you have many running
Docker containers, so you should use the ``tsm1`` engine in the InfluxDB
configuration file (no limit on columns number).
Note: if you want to use SSL, please set 'protocol=https'.
Grafana
-------

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
.TH "GLANCES" "1" "Jun 12, 2019" "3.1.1b0" "Glances"
.TH "GLANCES" "1" "Jul 03, 2019" "3.1.1b0" "Glances"
.SH NAME
glances \- An eye on your system
.

View File

@ -41,6 +41,7 @@ class Export(GlancesExport):
self.db = None
# Optionals configuration keys
self.protocole = 'http'
self.prefix = None
self.tags = None
@ -49,7 +50,9 @@ class Export(GlancesExport):
mandatories=['host', 'port',
'user', 'password',
'db'],
options=['prefix', 'tags'])
options=['protocol',
'prefix',
'tags'])
if not self.export_enable:
sys.exit(2)
@ -64,6 +67,8 @@ class Export(GlancesExport):
try:
db = InfluxDBClient(host=self.host,
port=self.port,
ssl=(self.protocol.lower() == 'https'),
verify_ssl=False,
username=self.user,
password=self.password,
database=self.db)