scripts that log content with telegraf so we can show it in grafana. These run on the host as they need access to logs/content that is underneath the containers

This commit is contained in:
2025-08-16 10:55:39 +10:00
parent 1eb28f6975
commit 968c171dae
3 changed files with 300 additions and 0 deletions

16
telegraf-watchtower-enabled Executable file
View File

@@ -0,0 +1,16 @@
#!/bin/bash
#
# an update, BUT, as prometheus is just looking at the last state of the file,
# it would see the last values and think they are 'current'.
#
# SO, lets date 'stamp' when we ran this, rather than give a boolean, because if
# its running this will update the date, if not, it wont anyway :)
log_file=/srv/docker/container/telegraf/monitoring-results/watchtower-enabled.influx
cnt=`egrep -v '^#' /srv/docker/config/docker-compose.yml | grep -c com.centurylinklabs.watchtower.enable`
tstamp=`date +%s%N`
# using influx format
echo mara_watchtower_enabled count=$cnt $tstamp > $log_file