mirror of
https://github.com/hassio-addons/addon-glances.git
synced 2025-05-05 03:21:36 +00:00
Fix influxdb2 configuration (#357)
This commit is contained in:
parent
2b3bca3e98
commit
15406b58e9
2 changed files with 12 additions and 5 deletions
|
@ -64,11 +64,11 @@ schema:
|
||||||
enabled: bool
|
enabled: bool
|
||||||
host: str
|
host: str
|
||||||
port: port
|
port: port
|
||||||
username: str
|
username: str?
|
||||||
password: password
|
password: password?
|
||||||
database: str
|
database: str?
|
||||||
org: str?
|
org: str?
|
||||||
prefix: str
|
prefix: str?
|
||||||
interval: int
|
interval: int
|
||||||
ssl: bool?
|
ssl: bool?
|
||||||
token: str?
|
token: str?
|
||||||
|
|
|
@ -26,6 +26,10 @@ if bashio::config.true 'influxdb.enabled'; then
|
||||||
|
|
||||||
# Modify the configuration
|
# Modify the configuration
|
||||||
if bashio::config.equals 'influxdb.version' '1'; then
|
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 "[influxdb]"
|
||||||
echo "user=$(bashio::config 'influxdb.username')"
|
echo "user=$(bashio::config 'influxdb.username')"
|
||||||
|
@ -34,8 +38,11 @@ if bashio::config.true 'influxdb.enabled'; then
|
||||||
echo "prefix=$(bashio::config 'influxdb.prefix')"
|
echo "prefix=$(bashio::config 'influxdb.prefix')"
|
||||||
} >> /etc/glances.conf
|
} >> /etc/glances.conf
|
||||||
elif bashio::config.equals 'influxdb.version' '2'; then
|
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 "org=$(bashio::config 'influxdb.org')"
|
||||||
echo "bucket=$(bashio::config 'influxdb.bucket')"
|
echo "bucket=$(bashio::config 'influxdb.bucket')"
|
||||||
echo "token=$(bashio::config 'influxdb.token')"
|
echo "token=$(bashio::config 'influxdb.token')"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue