Files
skyweave/skyweave-push.sh
T
wesandClaude Fable 5 6d0a8227a4
Skyweave Test, Lint, and Deploy Ritual / Test and Lint Code (push) Has been cancelled
Skyweave Test, Lint, and Deploy Ritual / Deploy to Roof Unit (push) Has been cancelled
AP-role metrics: client telemetry replaces dead STA/campground metrics
- metrics.lua: drop vif-sta0 station + campground-gateway sections (roof
  is a dumb AP since 2026-06-07); add skyweave_ap_* families — client
  count, per-client signal/SNR/bitrates/idle/association-time from
  iwinfo assoclist, noise floor, txpower, channel. Ping targets now
  chateau_gateway + talos_via_tunnel + internet (DNS).
- skyweave-push.sh: PUT instead of POST so departed-client series and
  retired families don't linger on the pushgateway; skip push when the
  local metrics fetch fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-09 19:40:11 -04:00

16 lines
620 B
Bash
Executable File

#!/bin/sh
# Push skyweave metrics to Prometheus pushgateway every 30 seconds.
# PUT (not POST) so the whole group is replaced each cycle — per-client
# series for departed stations don't linger. Skips the push if the local
# metrics fetch fails, so a CGI hiccup never blanks the group.
PUSHGW="http://192.168.88.44:9091/metrics/job/rvlink/instance/rvlink"
METRICS_URL="http://127.0.0.1:42069/cgi-bin/skyweave.lua/metrics"
while true; do
BODY=$(curl -sf "$METRICS_URL")
if [ -n "$BODY" ]; then
printf '%s\n' "$BODY" | curl -sf -X PUT --data-binary @- "$PUSHGW" >/dev/null 2>&1
fi
sleep 30
done