2026-09-15 18:47:02 +08:00
|
|
|
|
#!/usr/bin/env bash
|
2026-09-19 15:12:19 +08:00
|
|
|
|
. "$(cd "$(dirname "$0")/.." && pwd)/config/load.sh"
|
2026-09-15 18:47:02 +08:00
|
|
|
|
export PGPASSWORD=dshs_cluster_2026
|
2026-09-19 15:12:19 +08:00
|
|
|
|
Q() { /usr/bin/psql -h 127.0.0.1 -p "$DSHS_PG_PORT" -U dshs -d dshs -tAc "$1"; }
|
2026-09-15 18:47:02 +08:00
|
|
|
|
echo "=== users ==="
|
|
|
|
|
|
Q "select id || ' | ' || username || ' | ' || role || ' | uid=' || coalesce(uid::text,'-') from users order by row_id"
|
|
|
|
|
|
echo "=== dsh_instances ==="
|
|
|
|
|
|
Q "select id || ' | user=' || user_id || ' | ' || role || ' | ' || status || ' | host=' || coalesce(host_id,'NULL') || ' | epoch=' || epoch from dsh_instances order by id"
|
|
|
|
|
|
echo "=== dsh_hosts ==="
|
|
|
|
|
|
Q "select id || ' | cap=' || capacity_mb || ' | used=' || used_mb || ' | ' || status from dsh_hosts order by id"
|
|
|
|
|
|
echo "=== sessions(应为 0 条 switch-verify) ==="
|
|
|
|
|
|
Q "select count(*) from sessions where user_agent='switch-verify'"
|