Failed Service Report
List systemd units that are failed or restarting, with recent log lines.
$ webtoolist --script service-status-summary
Print active/inactive state for a list of systemd services.
systemdservicesstatusutilitiesDependencies: systemctl
#!/usr/bin/env bash
set -euo pipefail
read -r -a services <<< "${SERVICES:-ssh cron docker nginx}"
fail=0
for unit in "${services[@]}"; do
state="$(systemctl is-active "$unit" 2>/dev/null || true)"
enabled="$(systemctl is-enabled "$unit" 2>/dev/null || true)"
printf '%-16s %-10s %s\n' "$unit" "${state:-unknown}" "${enabled:-unknown}"
[[ "$state" == active ]] || fail=1
done
exit "$fail"
./service-status-summary
SERVICES='ssh nginx postgresql' ./service-status-summary
is-active returns the state on stdout even for missing units; the script labels unknown explicitly.systemctl list-units --type=service to discover the unit names on a new host.Related scripts
List systemd units that are failed or restarting, with recent log lines.
Report branch, dirty state, and ahead/behind for every Git repo under a directory.
Check systemd services and HTTP endpoints in one pass with a non-zero exit on failure.
Check PATH for missing, duplicate, or world-writable directories.