Skip to content

Commit

Permalink
🚑 Attempt to fix Influx Issues (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairpaul authored Mar 26, 2023
1 parent 28d21e9 commit e94fa5e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 5 additions & 3 deletions glances/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ The password for the above username option.

The name of the database to store all Glances information into.

If using Influx v2 the config value must be configured but will be ignored.

**Note**: _It is strongly recommended to create a separate database for glances
and not store this in the same database name as Home Assistant._

Expand All @@ -178,16 +180,16 @@ look like `t9iHPiGQyg0ds4K1IlBrCyBsNGh71dkdR6u8Y9eeR37UzfGuFukFCdbMI4YA9EtKb4zr5

#### Option `influxdb`: `bucket`

> Applied to version 1 only
> Applied to version 2 only

The name of the bucket to store all Glances information into.

**Note**: _It is strongly recommended to create a separate bucket for glances
and not store this in the same bucket as Home Assistant._

#### Option `influxdb`: `organization`
#### Option `influxdb`: `org`

> Applied to version 1 only
> Applied to version 2 only

The InfluxDB organization that owns the given bucket.

Expand Down
7 changes: 4 additions & 3 deletions glances/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ options:
password: ""
database: glances
prefix: localhost
token: ""
bucket: glances
org: myorg
schema:
log_level: list(trace|debug|info|notice|warning|error|fatal)
process_info: bool
Expand All @@ -63,15 +60,19 @@ schema:
certfile: str
keyfile: str
influxdb:
bucket: str?
enabled: bool
host: str
port: port
username: str
password: password
database: str
org: str?
prefix: str
interval: int
ssl: bool?
token: str?
version: int
leave_front_door_open: bool?
environment:
LOG_FORMAT: "{LEVEL}: {MESSAGE}"
8 changes: 4 additions & 4 deletions glances/rootfs/etc/cont-init.d/glances.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,16 @@ if bashio::config.true 'influxdb.enabled'; then
# Modify the configuration
if bashio::config.equals 'influxdb.version' '1'; then
{
echo "[influxb]"
echo "[influxdb]"
echo "user=$(bashio::config 'influxdb.username')"
echo "password=$(bashio::config 'influxdb.password')"
echo "db=$(bashio::config 'influxdb.database')"
echo "prefix=$(bashio::config 'influxdb.prefix')"
} >> /etc/glances.conf
elif bashio::config.equals 'influxdb.version' '2'; then
{
echo "[influxb2]"
echo "org=$(bashio::config 'influxdb.organization')"
echo "[influxdb 2]"
echo "org=$(bashio::config 'influxdb.org')"
echo "bucket=$(bashio::config 'influxdb.bucket')"
echo "token=$(bashio::config 'influxdb.token')"
} >> /etc/glances.conf
Expand All @@ -45,6 +46,5 @@ if bashio::config.true 'influxdb.enabled'; then
echo "protocol=${protocol}"
echo "host=$(bashio::config 'influxdb.host')"
echo "port=$(bashio::config 'influxdb.port')"
echo "prefix=$(bashio::config 'influxdb.prefix')"
} >> /etc/glances.conf
fi

0 comments on commit e94fa5e

Please sign in to comment.