From aef593030f4c4a878f42bd18db30c27ce80a71a5 Mon Sep 17 00:00:00 2001 From: Paul Sinclair Date: Sun, 10 May 2020 21:12:52 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A8Add=20optional=20configuration=20fo?= =?UTF-8?q?r=20history=5Fsize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 5 +++++ glances/config.json | 1 + glances/rootfs/etc/cont-init.d/glances.sh | 7 +++++++ 3 files changed, 13 insertions(+) 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'