Skip to main content

Heartbeat & Configuration

Heartbeat

The sensor periodically samples host metrics (internal/heartbeat) using gopsutil and POSTs them to POST /api/sensors/{id}/agent/heartbeat. The Defense Center uses these to track sensor health and online/offline status.

Sampled fields:

Field (JSON)Source
cpuUsagecpu.Percent (overall)
memoryUsed / memoryTotal / memoryPercentmem.VirtualMemory
per-interface countersnetwork interface sampling

Heartbeats are resilient: a failed POST is logged and retried on the next tick — it never crashes the agent.

The backend treats a sensor as offline when heartbeats stop for SensorSettings__HeartbeatTimeoutMinutes (see Deployment configuration).


Configuration

Configuration comes from environment variables and flags. Persisted credential files win over environment variables.

VariableDefaultDescription
SENSOR_IDset by enrollUnique sensor identifier
BACKEND_URLrequired before enrollDefense Center API base URL
SENSOR_TOKENnoneDurable post-enroll token; file wins over env
HEARTBEAT_INTERVAL30Seconds between heartbeats
SENSOR_PORT22SSH port reported during enrollment
SUDO_USERsensoradminPrivileged username reported
SENSOR_API_HOSTlocalhostData-collector gRPC host (daemon mode)
SENSOR_API_PORT50051Data-collector gRPC port (daemon mode)
SURICATA_SOCKET/var/run/suricata/suricata.sockSuricata eve.json unix socket path
FLUSH_INTERVAL_MS1000Queue flush/drain interval (ms)
RAVENXCOPE_LAUNCHERautoForce launcher: docker or systemd

mTLS material (cert/key/root-CA paths) and the NATS URL/creds are configured alongside these and are populated during enrollment.