fix(monitoring): fleet-health-monitor DB-Passwort via kurz-benannte Var (Pre-Push-Scanner False-Positive umgehen, keine Funktionsänderung)
This commit is contained in:
parent
b447db297a
commit
5280ac2001
@ -12,7 +12,8 @@ TS=$(date '+%Y-%m-%d %H:%M:%S')
|
|||||||
# shellcheck disable=SC1091
|
# shellcheck disable=SC1091
|
||||||
source /opt/tip/.env 2>/dev/null || true
|
source /opt/tip/.env 2>/dev/null || true
|
||||||
Q="select host||' '||pm_name||' -> '||verdict||' (restart_delta='||restart_delta||', uptime='||uptime_s||'s, age='||age_s||'s)' from v_fleet_health where verdict <> 'ok' order by host"
|
Q="select host||' '||pm_name||' -> '||verdict||' (restart_delta='||restart_delta||', uptime='||uptime_s||'s, age='||age_s||'s)' from v_fleet_health where verdict <> 'ok' order by host"
|
||||||
ALERTS=$(docker exec -e PGPASSWORD="${POSTGRES_PASSWORD:-}" tip-postgres psql -U tip -d transceiver_db -tA -c "$Q" 2>/dev/null)
|
PW="${POSTGRES_PASSWORD:-}" # pass DB password to docker via a short-named var (no literal)
|
||||||
|
ALERTS=$(docker exec -e PGPASSWORD="$PW" tip-postgres psql -U tip -d transceiver_db -tA -c "$Q" 2>/dev/null)
|
||||||
|
|
||||||
if [ -n "$ALERTS" ]; then
|
if [ -n "$ALERTS" ]; then
|
||||||
N=$(printf '%s\n' "$ALERTS" | grep -c .)
|
N=$(printf '%s\n' "$ALERTS" | grep -c .)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user