diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml index 0f865e7..90aa335 100644 --- a/.gitea/workflows/publish.yml +++ b/.gitea/workflows/publish.yml @@ -4,7 +4,6 @@ on: push: branches: - "master" - - "influx-only" jobs: docker: diff --git a/storage-tracker.sh b/storage-tracker.sh new file mode 100644 index 0000000..85e1c4b --- /dev/null +++ b/storage-tracker.sh @@ -0,0 +1,12 @@ +usage_engine=$(du -s /home/tracker/influx/db/engine/data/setme/ | cut -f1) +usage_wal=$(du -s /home/tracker/influx/db/engine/wal/setme/ | cut -f1) + +# Calculate the sum of usage_engine and usage_wal +total_usage=$((usage_engine + usage_wal)) + +docker exec influxdb influx write \ + --org homelab \ + --bucket influx_metrics \ + --token setme \ + --precision s \ + "storage_usage,db=mc-tracker value=$total_usage" \ No newline at end of file