From 8a31fb55ef76714f617f079b67a573906f9cea77 Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sat, 4 Jan 2025 14:22:20 +0100 Subject: prometheus: Add silentct_need_restart --- scripts/silentct-check | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'scripts/silentct-check') diff --git a/scripts/silentct-check b/scripts/silentct-check index 35d38c7..a6a79a3 100755 --- a/scripts/silentct-check +++ b/scripts/silentct-check @@ -76,6 +76,12 @@ while IFS= read -r line; do fi done <"$metrics_file" +#----------------------------------------------------------------------------------------- +# Parse restart metric +#----------------------------------------------------------------------------------------- +line=$(grep "^silentct_need_restart" "$metrics_file") +need_restart=$(echo $line | awk '{print $NF}') + #----------------------------------------------------------------------------------------- # Emit warnings #----------------------------------------------------------------------------------------- @@ -96,3 +102,7 @@ for stored_at in "${!certificate_alert[@]}"; do observed_at=$(awk "BEGIN {printf \"%.0f\", ${certificate_alert[$stored_at]}}") warn "(mis)-issued certificate? Observed at $(date -d @$observed_at) -- see $stored_at" done + +if [[ $need_restart != 0 ]]; then + warn "silentct-mon needs to be restarted" +fi -- cgit v1.2.3