SHA256
1
0
forked from pool/pcp-image
pcp-image/healthcheck

17 lines
348 B
Bash

#!/bin/bash -eu
ALL_PCP_SERVICES='pmcd,pmie,pmlogger,pmproxy'
PCP_SERVICES=${PCP_SERVICES:-${ALL_PCP_SERVICES}}
failed=""
for service in ${PCP_SERVICES//,/ }; do
if ! systemctl is-active $service --quiet; then
failed="$failed $service"
fi
done
if [ ! -z "$failed" ]; then
echo "$0: services not active:$failed"
exit 1
fi