fix auto acknowledge apt
This commit is contained in:
parent
2f6eaab905
commit
f277b2de1e
|
@ -47,6 +47,11 @@ while true; do
|
||||||
if [ "$response" == "200" ] || [ "$response" == "409" ]; then
|
if [ "$response" == "200" ] || [ "$response" == "409" ]; then
|
||||||
# 409 is okay because that means it's already been acknowledged.
|
# 409 is okay because that means it's already been acknowledged.
|
||||||
echo "All pending alerts have 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
|
else
|
||||||
echo "Failed to acknowledge the alerts. Status code: $response"
|
echo "Failed to acknowledge the alerts. Status code: $response"
|
||||||
if $EXIT_ON_FAILURE; then
|
if $EXIT_ON_FAILURE; then
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Auto Acknowledge all Icinga2 apt alerts
|
Description=Auto Acknowledge all Icinga2 apt alerts
|
||||||
|
Wants=icinga2.service icinga-director.service
|
||||||
|
Requires=icinga2.service icinga-director.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
User=flask
|
User=flask
|
||||||
|
|
Loading…
Reference in New Issue