A Bash status report can turn a small check count into a clear ready or blocked line without calling external services.

Program

Play the script to choose the failed check count and inspect the service health report.

failed_checks
service_health_report.sh
Replay: real traced execution (multi-file project)
#!/usr/bin/env bash

failed_checks=1
max_allowed=0
if (( failed_checks <= max_allowed )); then
    status="ready"
else
    status="blocked"
fi
echo "service=api failed=$failed_checks status=$status"
#!/usr/bin/env bash

failed_checks=0
max_allowed=0
if (( failed_checks <= max_allowed )); then
    status="ready"
else
    status="blocked"
fi
echo "service=api failed=$failed_checks status=$status"
  1. failed_checks ← 1

    3failed_checks=14max_allowed=0
    values this step1failed_checks
  2. max_allowed ← 0

    3failed_checks=14max_allowed=05if (( failed_checks <= max_allowed )); then
    values this step0max_allowed
  3. if (( failed_checks <= max_allowed )); then

    4max_allowed=05if (( failed_checks <= max_allowed )); then6    status="ready"
    values this step1failed_checks0max_allowed
  4. status ← blocked

    7else8    status="blocked"9fi
    values this stepblockedstatus
  5. echo "service=api failed=$failed_checks status=$status"

    9fi10echo "service=api failed=$failed_checks status=$status"
    outputservice=api failed=1 status=blocked
    values this step1failed_checksblockedstatus
  1. failed_checks ← 0

    3failed_checks=04max_allowed=0
    values this step0failed_checks
  2. max_allowed ← 0

    3failed_checks=04max_allowed=05if (( failed_checks <= max_allowed )); then
    values this step0max_allowed
  3. if (( failed_checks <= max_allowed )); then

    4max_allowed=05if (( failed_checks <= max_allowed )); then6    status="ready"
    values this step0failed_checks0max_allowed
  4. status ← ready

    5if (( failed_checks <= max_allowed )); then6    status="ready"7else
    values this stepreadystatus
  5. echo "service=api failed=$failed_checks status=$status"

    9fi10echo "service=api failed=$failed_checks status=$status"
    outputservice=api failed=0 status=ready
    values this step0failed_checksreadystatus
check count The script keeps the service signal as one numeric count.
status branch The threshold branch converts the count into a ready or blocked label.
report line The final echo emits a stable status line that another tool could parse.