diff options
author | Rasmus Dahlberg <rgdd@glasklarteknik.se> | 2025-01-04 14:22:20 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rgdd@glasklarteknik.se> | 2025-01-04 14:22:20 +0100 |
commit | 8a31fb55ef76714f617f079b67a573906f9cea77 (patch) | |
tree | 8821e2b41c4e32502debb461558d10007fddf0cf /scripts | |
parent | 2d4c4b7ac260958b73527c5df366ba4944f4cd13 (diff) |
prometheus: Add silentct_need_restart
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/silentct-check | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/silentct-check b/scripts/silentct-check index 35d38c7..a6a79a3 100755 --- a/scripts/silentct-check +++ b/scripts/silentct-check @@ -77,6 +77,12 @@ while IFS= read -r line; do done <"$metrics_file" #----------------------------------------------------------------------------------------- +# Parse restart metric +#----------------------------------------------------------------------------------------- +line=$(grep "^silentct_need_restart" "$metrics_file") +need_restart=$(echo $line | awk '{print $NF}') + +#----------------------------------------------------------------------------------------- # Emit warnings #----------------------------------------------------------------------------------------- now=$(date +%s) @@ -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 |