fix auto acknowledge apt

This commit is contained in:
Cyberes 2024-02-27 22:08:06 -07:00
parent 2f6eaab905
commit f277b2de1e
2 changed files with 7 additions and 0 deletions

View File

@ -47,6 +47,11 @@ while true; do
if [ "$response" == "200" ] || [ "$response" == "409" ]; then
# 409 is okay because that means it's already been acknowledged.
echo "All pending alerts have been acknowledged."
elif [ "$response" == "000" ]; then
echo "ERROR: failed to reach Icinga2 server. Sleeping 60s..."
sleep 60
elif [ "$response" == "404" ]; then
echo "Icinga reported no services to acknowledge."
else
echo "Failed to acknowledge the alerts. Status code: $response"
if $EXIT_ON_FAILURE; then

View File

@ -1,5 +1,7 @@
[Unit]
Description=Auto Acknowledge all Icinga2 apt alerts
Wants=icinga2.service icinga-director.service
Requires=icinga2.service icinga-director.service
[Service]
User=flask