From e380d7ae3906804bb24c3501f28b8aa6087f60e2 Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Sat, 27 Jul 2019 16:03:12 -0400 Subject: [PATCH] :ambulance: Add https/http for InfluxDB fixes #25 --- README.md | 8 +++++++- glances/config.json | 6 ++++-- glances/rootfs/etc/cont-init.d/glances.sh | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3ef5150..61c3b7c 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,8 @@ Example add-on configuration: "password": "!secret glances_influxdb_password", "database": "glances", "prefix": "localhost", - "interval": 60 + "interval": 60, + "protocol": "http" } } ``` @@ -173,6 +174,11 @@ The hostname to append for exported data. Defines the interval (in seconds) on how often Glances exports data to InfluxDB. +#### Option `influxdb`: `protocol` + +Use `http` or `https` to connect to InfluxDB. Set to `http` if using the +Community InfluxDB add-on + ## Adding Glances as a sensor into Home Assistant The Home Assistant Glances sensor platform is consuming the system information diff --git a/glances/config.json b/glances/config.json index 49caac0..00e61c3 100755 --- a/glances/config.json +++ b/glances/config.json @@ -53,7 +53,8 @@ "password": "", "database": "glances", "prefix": "localhost", - "interval": 60 + "interval": 60, + "protocol": "http" } }, "schema": { @@ -71,7 +72,8 @@ "password": "str", "database": "str", "prefix": "str", - "interval": "int" + "interval": "int", + "protocol": "match(^(http|https)$)" }, "leave_front_door_open": "bool?" }, diff --git a/glances/rootfs/etc/cont-init.d/glances.sh b/glances/rootfs/etc/cont-init.d/glances.sh index f8c2128..de798de 100644 --- a/glances/rootfs/etc/cont-init.d/glances.sh +++ b/glances/rootfs/etc/cont-init.d/glances.sh @@ -27,5 +27,6 @@ if bashio::config.true 'influxdb.enabled'; then echo "password=$(bashio::config 'influxdb.password')" echo "db=$(bashio::config 'influxdb.database')" echo "prefix=$(bashio::config 'influxdb.prefix')" + echo "protocol=$(bashio::config 'influxdb.protocol')" } >> /etc/glances.conf fi