Agent
tier-agent sends host telemetry over Tier. It is an optional application in the Tier
package; installing the package does not enable it. Each monitored host and the collector must run
tierd and join the same network.
- An agent emits samples.
- A collector receives and stores them, exposes a local query socket, and can serve a web dashboard.
- A manually configured instance can use
role = "both"to run an agent and a collector on the same host.
Each agent and collector has its own Tier user identity (see Identities in applications). Samples travel as end-to-end sealed messages: communicators can relay them but cannot read them.
Quick start
On the collector, bootstrap the service:
sudo tier-agent bootstrap collector --enable-web-server
It prints the command to run on each monitored host, with the collector's Tier address filled in:
sudo tier-agent bootstrap client --collector=<COLLECTOR-ADDRESS>
Bootstrap writes the config and the identity seed under /etc/tier and
/var/lib/tier-agent, then enables and starts the matching systemd unit. The packaged
host-metrics source reports load, memory, disk, uptime, and systemd unit state every 15 seconds.
systemctl status tier-agent@collector.service
systemctl status tier-agent@agent.service
Agent Tier ID
Print the agent's 64-character hexadecimal user ID, the sender ID shown by the collector dashboard:
sudo tier-agent id
By default this reads /etc/tier/agent.toml. For the collector identity or another
config, pass it explicitly:
sudo tier-agent id --config /etc/tier/collector.toml
Web dashboard
The dashboard is disabled by default. --enable-web-server adds a [web]
section to /etc/tier/collector.toml and starts the dashboard on
127.0.0.1:8080. Reach it from another machine through SSH:
ssh -N -L 8080:127.0.0.1:8080 operator@collector
Then open http://127.0.0.1:8080/.
The collector owns the web listener: a [web] section turns it on, removing the section
turns it off, and a restart applies the change. To enable it on an existing collector:
[web]
bind_address = "127.0.0.1"
port = 8080
[collector]
query_socket = "/run/tier-agent/agent-query.sock"
sudo systemctl restart tier-agent@collector.service
Address and port
bind_address and port default to 127.0.0.1 and
8080. 0.0.0.0 listens on all IPv4 interfaces, :: on all IPv4
and IPv6 interfaces; a single IPv4 or IPv6 address also works. The setting takes an IP address, not
an interface name or a scoped link-local address. From another host, open
http://<collector-ip>:<port>/, with IPv6 in brackets, for example
http://[2001:db8::10]:8080/.
The web server has no authentication and no TLS. Binding to 0.0.0.0
or :: exposes telemetry to any host that can reach the port. Restrict access with a
firewall, or put it behind a trusted reverse proxy that provides TLS and authentication.
Fleet labels
An optional JSON file labels expected senders and sets freshness and refresh intervals. Nodes are
keyed by their 64-hex Tier ID, as printed by tier-agent id:
{
"stale_after_seconds": 60,
"refresh_seconds": 10,
"nodes": {
"0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef": {
"name": "edge-01",
"tags": ["edge", "production"]
}
}
}
[web]
dashboard_config = "/etc/tier/fleet.json"
Samples
A source writes one sample per line, to standard input or as the agent's periodic
exec command:
gauge cpu.load 0.42
gauge host.mem_used_pct 51.7
event deploy.release v1.2.3 started
gauge(org) is a replaceable value: the newest value per sender and key is kept.event(ore) is append-only history.- The value is the rest of the line and may be arbitrary text. Blank lines and lines starting with
#are ignored.
A systemd service has no standard input, so an agent run by its unit must set exec.
The packaged source is /usr/libexec/tier/host-metrics.sh.
Delivery is best-effort and online-only. Samples sent while the collector is unavailable are not spooled for later replay.
Reading collected data
The collector stores data under /var/lib/tier-agent/data. Gauges are kept as a
snapshot; events are stored in segments and retained for seven days by default. Read a snapshot
on the collector host, optionally filtered by a substring of the sender/key label:
sudo tier-agent query /run/tier-agent/agent-query.sock
sudo tier-agent query /run/tier-agent/agent-query.sock cpu
The dashboard shows current gauges and recent events. It is a local overview, not a time-series database: there is no gauge history, alerting, or offline replay.
Extending telemetry
Use exec to collect samples from any local command. Sending data to another backend
needs a collector sink compiled into tier-agent; there are no built-in Prometheus,
InfluxDB, or OTLP sinks, and runtime-loadable plugins are not supported. See
Agent adapters.
Configuration
Bootstrap writes /etc/tier/agent.toml or /etc/tier/collector.toml. The
packaged templates are in /usr/share/tier/agent/. Edit the active config and restart
the matching unit to apply changes. The systemd template tier-agent@.service runs
tier-agent --config /etc/tier/<instance>.toml; the package does not start any
instance by itself.
| Key | Meaning |
|---|---|
role | agent, collector, or both. |
admin_socket | Admin socket of the local tierd; /run/tierd/tierd.sock. |
seed_file | This instance's identity seed, for example /var/lib/tier-agent/agent-agent.seed. |
[agent] | |
collector | The collector's Tier address, elided or tier1…. |
interval | Seconds between batched flushes. The packaged config uses 15. |
max_batch | Flush early once this many samples are buffered. |
exec | Command run every interval; its output is parsed as samples. Without it the source is standard input. |
[collector] | |
store | Directory for the gauge snapshot and event segments. |
retention | Drop events older than this, with unit s, m, h, or d; 0 keeps everything. Packaged: 7d. |
max_bytes | Optional cap on the event log, for example "2GB"; the oldest events are dropped first. |
snapshot_interval | Cadence of the gauge snapshot and retention sweep, for example "60s". |
persistence | local, the only implemented backend. keeper is accepted but ignored. |
query_socket | Local read socket, /run/tier-agent/agent-query.sock. |
query_socket_group | Group granted access to the query socket. |
accept_from | Allowlist of agent addresses. Omitted: accept any sender. |
[web] | |
bind_address | IP address to listen on; default 127.0.0.1. |
port | Port; default 8080. |
dashboard_config | Optional fleet labels file. |
Typical files:
# /etc/tier/agent.toml
role = "agent"
admin_socket = "/run/tierd/tierd.sock"
seed_file = "/var/lib/tier-agent/agent-agent.seed"
[agent]
collector = "tier1..."
interval = 15
exec = "/usr/libexec/tier/host-metrics.sh"
# /etc/tier/collector.toml
role = "collector"
admin_socket = "/run/tierd/tierd.sock"
seed_file = "/var/lib/tier-agent/agent-collector.seed"
[collector]
store = "/var/lib/tier-agent/data"
retention = "7d"
query_socket = "/run/tier-agent/agent-query.sock"
persistence = "local"
The units run as root, because the tierd admin socket is accessible to root only. A
hardened variant with a dedicated unprivileged account is planned but not shipped.