diff --git a/README.md b/README.md index 2d07d38..c2f6993 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,7 @@ Example add-on configuration: "username": "glances", "password": "!secret glances_influxdb_password", "database": "glances", + "prefix": "localhost", "interval": 60 } } @@ -148,6 +149,10 @@ The password for the above username option. The name of the database to store all Glances information into. +#### Option `prefix`: `localhost` + +The hostname to append for exported data **Note for the Grafana Glances dashboard set this to localhost. + **Note**: _It is strongly recommended to create a separate database for glances and not store this in the same database name as Home Assistant._ diff --git a/glances/config.json b/glances/config.json index b2e50f1..6ed15ba 100755 --- a/glances/config.json +++ b/glances/config.json @@ -39,6 +39,7 @@ "username": "glances", "password": "", "database": "glances", + "prefix": "localhost", "interval": 60 } }, @@ -54,6 +55,7 @@ "username": "str", "password": "str", "database": "str", + "prefix": "str", "interval": "int" }, "leave_front_door_open": "bool?" diff --git a/glances/rootfs/etc/cont-init.d/30-influxdb.sh b/glances/rootfs/etc/cont-init.d/30-influxdb.sh index bec203b..471f496 100644 --- a/glances/rootfs/etc/cont-init.d/30-influxdb.sh +++ b/glances/rootfs/etc/cont-init.d/30-influxdb.sh @@ -18,4 +18,5 @@ fi echo "user=$(hass.config.get 'influxdb.username')" echo "password=$(hass.config.get 'influxdb.password')" echo "db=$(hass.config.get 'influxdb.database')" + echo "prefix=$(hass.config.get 'influxdb.prefix')" } >> /etc/glances.conf