Service, status, and logs
How the CloudStats agent runs under systemd, where it stores data, how to read logs, and how often it collects metrics.
Updated Nov 7, 2026
The Linux agent runs as a systemd service named cloudstats-agent.
Service#
Unit file: /etc/systemd/system/cloudstats-agent.service
Verified settings from that unit:
- Starts after
network-online.target Restart=alwayswithRestartSec=5RestartPreventExitStatus=87(used when a deleted server is committed locally; see Uninstall the agent)TimeoutStopSec=20- Runs as root
ProtectSystem=strictandPrivateTmp=true- Write access only to
/etc/cloudstatsand/var/lib/cloudstats
Commands:
systemctl status cloudstats-agent
journalctl -u cloudstats-agentThe website treats a server as online when the agent has made authenticated contact within the last 60 seconds. That is contact with CloudStats, not a guarantee that the latest chart point was stored.
Collection interval#
The agent collects on an interval stored in /etc/cloudstats/agent.json as next_interval_seconds. The default is 10 seconds. The agent clamps values into 5–3600 seconds.
One collection cycle writes one batch. CPU percents and byte-per-second rates need a previous sample, so they are omitted from the first cycle for that series. See Current metrics catalog.
If the host cannot reach CloudStats, batches stay in a local queue under /var/lib/cloudstats/wal/ (at most 64 MiB or 512 files). Replay is oldest-first. Charts that read the latest snapshot can lag until that queue drains.
Files on the host#
| Path | Role |
|---|---|
/usr/local/bin/cloudstats-agent | Agent binary |
/etc/cloudstats/agent.json | Permanent config (mode 0600). Not an enrollment token. |
/etc/cloudstats/no-self-update | Opt out of auto-update, if present |
/etc/cloudstats/no-self-uninstall | Opt out of uninstall-on-delete, if present |
/var/lib/cloudstats/wal/ | Local metric queue |
/usr/local/lib/cloudstats/uninstall.sh | Uninstall helper |
/usr/local/lib/cloudstats/update.sh | Update helper (current installer) |
Logs#
The agent writes JSON logs to stdout. systemd captures them:
journalctl -u cloudstats-agentSuccessful start logs agent running with server_id and agent_id. Enrollment logs those ids and does not log the enrollment token or the permanent credential.
Website status versus charts#
| Signal | Meaning |
|---|---|
| Server online | Authenticated agent contact within 60 seconds |
| Latest metrics on a detail page | Last accepted metric batch |
| Empty CPU or rate charts right after start | First sample has no delta yet |
If the agent is online but charts are stale, the host may be retrying a backlog or CloudStats may be accepting contact without yet accepting a batch. See Troubleshooting.
