Health endpoints
On this page
The agent serves three small read-only HTTP endpoints, so that you — or Docker, Kubernetes, a container platform, your own supervision — can check it from its machine without opening Onagre.
The endpoints#
| Endpoint | Answers | Use it as |
|---|---|---|
GET /health |
200 {"status":"Healthy"} while the process runs. |
Liveness probe. |
GET /ready |
200 {"status":"Ready"} when the agent is connected to the Hub; otherwise 503 with a reason. |
Readiness probe, post-install check. |
GET /status |
Version, uptime, connection and activity. | Diagnosis. |
curl -s http://127.0.0.1:27520/ready{ "status": "NotReady", "reason": "Hub stream not established: Another agent is already connected with this token" }/status returns, for example:
{
"status": "Running",
"version": "2.8.4.112",
"startedAt": "2026-10-12T06:02:11Z",
"uptimeSeconds": 13412,
"ready": true,
"configurationLoaded": true,
"hubConnected": true,
"mode": "advanced",
"lastHubCommunication": "2026-10-12T09:45:41Z",
"lastSensorExecution": "2026-10-12T09:45:38Z",
"sensorExecutions": 4127
}| Field | Meaning |
|---|---|
mode |
advanced for an Advanced agent, standard for a Core agent. |
hubConnected |
The connection with the Hub is up. |
lastHubCommunication |
Last exchange with the Hub. |
lastSensorExecution, sensorExecutions |
Last check run, and number of checks since startup. |
The endpoints return no token, no address and no configuration. Calling them often costs nothing: they never contact the Hub.
Settings#
| Variable | Default | Purpose |
|---|---|---|
PORT |
27520 |
Listening port. |
HTTP_API_BIND |
127.0.0.1 |
Listening address. 127.0.0.1 (or loopback): only from the machine itself. 0.0.0.0: every IPv4 interface. A specific address of the machine, for example 192.168.1.20. any: every IPv4 and IPv6 interface. |
HTTP_API |
on | 0 turns the endpoints off. |
By default, nothing is exposed to the network.
Exposing the endpoints
With a non-loopback HTTP_API_BIND (0.0.0.0, any, an address of the machine), the endpoints answer anyone who can reach that port, without authentication. They return no token nor configuration, but protecting them — firewall, security group — is up to you: the agent and its installer create no firewall rule.
For example, in /etc/onagent/onagent.env on Linux:
HTTP_API_BIND=192.168.1.20
PORT=27521The endpoints start once the agent has authenticated with Onagre. Before that — API unreachable, wrong token — they do not answer: read the agent's log instead. If the port is already taken, the agent logs a warning and keeps monitoring.
Examples#
docker run -d --name onagre-agent --restart=always \
--env-file ./onagre-agent.env \
--health-cmd "curl -fsS http://127.0.0.1:27520/health || exit 1" \
--health-interval 30s \
onagreio/agentenv:
- name: HTTP_API_BIND
value: "any"
livenessProbe:
httpGet: { path: /health, port: 27520 }
periodSeconds: 30
readinessProbe:
httpGet: { path: /ready, port: 27520 }
periodSeconds: 30curl -s http://127.0.0.1:27520/statusTroubleshooting#
| Symptom | Likely cause |
|---|---|
| Connection refused | The agent is not started yet, is still waiting for the API, or its token was refused — read its log. Or the endpoints are off (HTTP_API) or on another PORT. |
/ready stays 503 — Hub stream not established |
The Hub cannot be reached on port 443 (firewall, proxy), or another agent already uses this token. |
lastHubCommunication is old |
The connection dropped: the agent reconnects on its own; check the network path. |