Files
bin/telegraf-watchtower-enabled

17 lines
604 B
Bash
Executable File

#!/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