Skip to content

Commit

Permalink
Fix influxdb2 configuration (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored May 8, 2023
1 parent 2b3bca3 commit 15406b5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
8 changes: 4 additions & 4 deletions glances/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ schema:
enabled: bool
host: str
port: port
username: str
password: password
database: str
username: str?
password: password?
database: str?
org: str?
prefix: str
prefix: str?
interval: int
ssl: bool?
token: str?
Expand Down
9 changes: 8 additions & 1 deletion glances/rootfs/etc/cont-init.d/glances.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ if bashio::config.true 'influxdb.enabled'; then

# Modify the configuration
if bashio::config.equals 'influxdb.version' '1'; then
bashio::config.require "influxdb.username"
bashio::config.require "influxdb.password"
bashio::config.require "influxdb.database"
bashio::config.require "influxdb.prefix"
{
echo "[influxdb]"
echo "user=$(bashio::config 'influxdb.username')"
Expand All @@ -34,8 +38,11 @@ if bashio::config.true 'influxdb.enabled'; then
echo "prefix=$(bashio::config 'influxdb.prefix')"
} >> /etc/glances.conf
elif bashio::config.equals 'influxdb.version' '2'; then
bashio::config.require "influxdb.org"
bashio::config.require "influxdb.bucket"
bashio::config.require "influxdb.token"
{
echo "[influxdb 2]"
echo "[influxdb2]"
echo "org=$(bashio::config 'influxdb.org')"
echo "bucket=$(bashio::config 'influxdb.bucket')"
echo "token=$(bashio::config 'influxdb.token')"
Expand Down

0 comments on commit 15406b5

Please sign in to comment.