DERIOX GUARD M9.7

Gateway Status From Real Agent

Agentul real poate cere statusul curent: heartbeat văzut, pairing aprobat, binding creat. Fără servicii automate și fără camere.

Status score100
Queries1
Known gateways1
Bound1
Service0
Cameras0
M9.7 citește starea reală din M9.4/M9.5/M9.6. Nu pornește service/cron, nu activează producția, nu scanează camere și nu deschide stream.
DashboardGatewaysQueriesCommandsStatus ScriptAuditAPI StatusDownload ScriptM9.6 Approval

M9.7 Gateway Status From Real Agent

M9.7 lets a real mini PC ask Guard for its current status after heartbeat, pairing request and admin approval. It reads existing M9.4 heartbeat, M9.5 pairing and M9.6 binding data. It does not start service/cron, does not enable production, camera discovery, streams, media or billing.

last_query=2026-05-29 23:35:34 · reads_binding=1 · reads_heartbeat=1 · service=0 · camera=0

Manual gateway status script

#!/bin/bash
set -e

echo "=================================================="
echo "DERIOX GUARD - MANUAL GATEWAY STATUS M9.7"
echo "=================================================="
echo "This queries Guard for the current gateway status."
echo "It does NOT start a service, does NOT scan cameras,"
echo "does NOT send camera passwords, streams or media."
echo ""

CONF="/etc/deriox-guard/agent.env"
GUARD_URL="https://guard.deriox.ro"
AGENT_NAME="mini-pc-pilot-01"
GATEWAY_UUID=""

if [ -f "$CONF" ]; then
  # shellcheck disable=SC1090
  source "$CONF" || true
  if [ -n "${DERIOX_GUARD_URL:-}" ]; then GUARD_URL="$DERIOX_GUARD_URL"; fi
  if [ -n "${DERIOX_AGENT_NAME:-}" ]; then AGENT_NAME="$DERIOX_AGENT_NAME"; fi
  if [ -n "${DERIOX_GATEWAY_UUID:-}" ]; then GATEWAY_UUID="$DERIOX_GATEWAY_UUID"; fi
fi

HOST_NAME="$(hostname 2>/dev/null || echo unknown)"
OS_NAME="$(uname -a 2>/dev/null | tr '"' "'" | tr -d '\n')"
MACHINE_ID="$(cat /etc/machine-id 2>/dev/null || hostname)"
MACHINE_HASH="$(printf "%s" "$MACHINE_ID" | sha256sum | awk '{print $1}')"
LOCAL_IP="$(hostname -I 2>/dev/null | awk '{print $1}' || echo '')"

if [ -z "$GATEWAY_UUID" ]; then
  GATEWAY_UUID="manual-${HOST_NAME}-$(printf "%s" "$MACHINE_HASH" | awk '{print substr($1,1,16)}')"
fi

PAYLOAD=$(cat <<JSON
{
  "gateway_uuid": "$GATEWAY_UUID",
  "agent_name": "$AGENT_NAME",
  "agent_version": "m9.7-manual-status",
  "host_name": "$HOST_NAME",
  "os_name": "$OS_NAME",
  "machine_hash": "$MACHINE_HASH",
  "local_ip": "$LOCAL_IP",
  "manual_run": 1,
  "service_autostart_enabled": 0,
  "cron_enabled": 0,
  "production_go_live_enabled": 0,
  "real_camera_access_enabled": 0,
  "camera_discovery_enabled": 0,
  "stream_link_enabled": 0,
  "media_enabled": 0,
  "billing_enabled": 0
}
JSON
)

echo "Gateway UUID: $GATEWAY_UUID"
echo "Agent name:   $AGENT_NAME"
echo "Endpoint:     $GUARD_URL/api/gateway/mini-pc/gateway-status"
echo ""

curl -k -sS \
  -H "Content-Type: application/json" \
  -X POST "$GUARD_URL/api/gateway/mini-pc/gateway-status" \
  --data "$PAYLOAD"

echo ""
echo "M9.7 manual gateway status query complete."