Files
felhom.eu/documentation/audits/night-2026-10-21/tools/outside.sh
T

16 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# outside.sh — the soak's second channel (night 2026-10-21 Part 1; the fixes-2026-10-21 probe), on DooPlex, ~11 h:
# every 10 s: the dashboard's /api/health latency (the household's door) + demo-hp's view of VM 9322 (qemu disk I/O);
# every 60 s: copy the box's rec.jsonl to the evidence folder.
K=/tmp/claude-1000/-mnt-5-hdd-felhom-eu-git/38fde0c6-e964-4ec1-b0c7-56e62d675225/scratchpad/kh_night
D=/mnt/5_hdd/felhom.eu/git/felhom.eu/documentation/audits/night-2026-10-21/P1-soak
end=$(($(date +%s)+40000)); n=0
while [ $(date +%s) -lt $end ]; do
t=$(date -u +%FT%TZ)
h=$(curl -sk -m 15 -o /dev/null -w "%{http_code} %{time_total}" -H "Host: felhom.tester4.test" https://192.168.0.125/api/health)
q=$(ssh -o ConnectTimeout=5 hp 'p=$(cat /var/run/qemu-server/9322.pid 2>/dev/null); awk "/read_bytes|write_bytes/{printf \"%s \", \$2}" /proc/$p/io 2>/dev/null' 2>/dev/null)
echo "$t health=$h qemu_rw=$q" >> $D/02-outside.txt
n=$((n+1)); if [ $((n % 6)) -eq 0 ]; then scp -q -o UserKnownHostsFile=$K -o ConnectTimeout=10 root@192.168.0.128:/root/rec/rec.jsonl $D/03-rec.jsonl 2>/dev/null; fi
sleep 10
done