check_systemd_service: also check if service is activating
This commit is contained in:
parent
87d752780a
commit
9b5d5e88a8
|
@ -48,7 +48,10 @@ fi
|
||||||
active=$(systemctl is-active "$UNIT")
|
active=$(systemctl is-active "$UNIT")
|
||||||
substate=$(systemctl show "$UNIT" --property=SubState --value)
|
substate=$(systemctl show "$UNIT" --property=SubState --value)
|
||||||
|
|
||||||
if [ "$active" != "active" ] || { [ "$substate" = "exited" ] && [ "$IS_TIMER" = false ]; }; then
|
if [ "$active" = "activating" ]; then
|
||||||
|
echo "WARNING - $UNIT is activating"
|
||||||
|
exit 1
|
||||||
|
elif [ "$active" != "active" ] || { [ "$substate" = "exited" ] && [ "$IS_TIMER" = false ]; }; then
|
||||||
echo "CRITICAL - $UNIT is not active"
|
echo "CRITICAL - $UNIT is not active"
|
||||||
exit 2
|
exit 2
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue