diff --git a/README.md b/README.md index 6f6d02a..6fee27e 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,11 @@ The private key file to use for SSL. **Note**: _The file MUST be stored in `/ssl/`, which is the default_ +### Option: `history_size` + +If specified changes the time Glances will retain data. Default if not set is +28800: 1 day with 1 point every 3 seconds. + ### Option group `influxdb` --- diff --git a/glances/config.json b/glances/config.json index 02736dc..68a5813 100755 --- a/glances/config.json +++ b/glances/config.json @@ -51,6 +51,7 @@ "ssl": "bool", "certfile": "str", "keyfile": "str", + "history_size": "int?", "influxdb": { "enabled": "bool", "host": "str", diff --git a/glances/rootfs/etc/cont-init.d/glances.sh b/glances/rootfs/etc/cont-init.d/glances.sh index abb50b3..9ac8cb1 100644 --- a/glances/rootfs/etc/cont-init.d/glances.sh +++ b/glances/rootfs/etc/cont-init.d/glances.sh @@ -17,6 +17,13 @@ else cp /etc/glances.conf /config/glances/ fi +# Set History Size +history_size=28800 + if bashio::config.exists 'history_size'; then + history_size=$(bashio::config 'history_size') + fi +sed -i "s#history_size=28800#history_size=${history_size}#g" /etc/glances.conf + # Export Glances data to InfluxDB if bashio::config.true 'influxdb.enabled'; then protocol='http'