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

On this page

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=always with RestartSec=5
  • RestartPreventExitStatus=87 (used when a deleted server is committed locally; see Uninstall the agent)
  • TimeoutStopSec=20
  • Runs as root
  • ProtectSystem=strict and PrivateTmp=true
  • Write access only to /etc/cloudstats and /var/lib/cloudstats

Commands:

sh
systemctl status cloudstats-agent
journalctl -u cloudstats-agent

The 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#

PathRole
/usr/local/bin/cloudstats-agentAgent binary
/etc/cloudstats/agent.jsonPermanent config (mode 0600). Not an enrollment token.
/etc/cloudstats/no-self-updateOpt out of auto-update, if present
/etc/cloudstats/no-self-uninstallOpt out of uninstall-on-delete, if present
/var/lib/cloudstats/wal/Local metric queue
/usr/local/lib/cloudstats/uninstall.shUninstall helper
/usr/local/lib/cloudstats/update.shUpdate helper (current installer)

Logs#

The agent writes JSON logs to stdout. systemd captures them:

sh
journalctl -u cloudstats-agent

Successful 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#

SignalMeaning
Server onlineAuthenticated agent contact within 60 seconds
Latest metrics on a detail pageLast accepted metric batch
Empty CPU or rate charts right after startFirst 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.