Node Management
OSAPI can query and update system-level information on managed nodes. All node operations run through the job system, so the API server never needs direct access to the host.
Agent vs. Node
OSAPI separates agent fleet discovery from node system queries:
- Agent commands (
agent list,agent get) read directly from the NATS KV heartbeat registry. They show which agents are online, their labels, lightweight metrics, and node conditions from the last heartbeat. No jobs are created. Agents also expose typed system facts (architecture, kernel version, FQDN, CPU count, network interfaces, service manager, package manager) gathered every 60 seconds via providers and stored in a separateagent-factsKV bucket with a 5-minute TTL. The API merges registry and facts data into a singleAgentInforesponse. Agents can be drained for maintenance without stopping the process. - Node commands (
node hostname,node status) dispatch jobs to agents that execute system commands and return detailed results (disk usage, full memory breakdown, etc.).
What It Manages
| Resource | Description |
|---|---|
| Hostname | Get or update the system hostname |
| Status | Uptime, OS name and version, kernel, platform info |
| Disk | Per-mount usage (total, used, free, percent) |
| Memory | RAM and swap usage (total, used, free, percent) |
| Load | 1-, 5-, and 15-minute load averages |
| System Facts | Architecture, kernel, FQDN, CPUs, NICs, routes, service/pkg mgr |
How It Works
Node queries are submitted as jobs. The CLI posts a job to the API server, the API server publishes it to NATS, an agent picks it up and reads the requested system information, then writes the result back to NATS KV. The CLI polls for the result and displays it.
Network and command operations are also nested under the node — see Network Management and Command Execution for those domains.
You can target a specific host, broadcast to all hosts, or route by label. See Node CLI Reference for job-based commands and Agent CLI Reference for registry-based fleet discovery, or the API Reference for the REST endpoints.
Configuration
Node management uses the general job infrastructure. No domain-specific configuration is required. See Configuration for NATS, agent, and authentication settings.
Permissions
Node read endpoints require node:read. Hostname update requires node:write.
Agent fleet discovery endpoints require agent:read. The built-in admin and
write roles include node:read and node:write. The read role includes
node:read only.
Related
- Agent CLI Reference -- agent fleet commands
- Node CLI Reference -- node job commands
- System Facts -- fact collection and
@fact.*references - API Reference -- REST API documentation
- Job System -- how async job processing works
- Architecture -- system design overview