Menu

Site navigation

LivePulser
Browse the docs

Agent configuration reference

Every agent.conf option, command-line flag and file location.

This is the reference for the LivePulser resource agent: its configuration file, command-line flags, exit codes, file locations and how it talks to LivePulser. For step-by-step installation, see Install the server agent; for how to get the agent, see Get the agent. For metrics, thresholds and alert timing, see Server resource monitoring.

agent.conf

The configuration file uses key=value lines. Spaces around the key and value are ignored, and so are blank lines and lines starting with #. Unknown keys are an error, so a typo can't go unnoticed, and each key may appear only once. The file may be at most 16 KiB.

KeyRequiredDescription
endpointYesThe API origin: https://rs.livepulser.com. It must be an origin only (no path, query or user name). Plain http:// is accepted only for a loopback address, for testing.
monitor_idYesThe resource monitor's ID, a UUID. It's shown on the monitor page under Agent connection & API key.
api_key_fileYes*Absolute path to the file that holds the monitor's API key. *Can be left out under systemd when the key is passed with LoadCredential=api-key:… (see below).
state_dirNoAbsolute path to the session state folder. Defaults to $STATE_DIRECTORY (set by systemd) or the platform default below. On Linux and macOS it must be owned by the agent's user and not writable by group or others.
ca_fileNoAbsolute path to a CA bundle to trust instead of the system store, for example for a proxy that intercepts TLS. Linux and macOS only; on Windows, setting it is an error, so add the CA to the Windows certificate store instead.
proxyNoAn HTTP proxy URL, such as http://proxy.example.com:3128. System and environment proxy settings (including https_proxy and the Windows proxy) are always ignored; this is the only way to use a proxy.
/etc/livepulser-agent/agent.conf (Linux)
# LivePulser resource agent configuration.
# Everything else (interval, disk path, network interface, thresholds) is managed in the dashboard.

endpoint=https://rs.livepulser.com
monitor_id=<monitor-id>
api_key_file=/etc/livepulser-agent/api-key

# Optional:
# state_dir=/var/lib/livepulser-agent
# ca_file=/etc/ssl/certs/ca-certificates.crt
# proxy=http://proxy.example.com:3128

On macOS, api_key_file is /usr/local/etc/livepulser-agent/api-key. On Windows, the install script writes the file for you, with api_key_file=C:\ProgramData\LivePulser\api-key and state_dir=C:\ProgramData\LivePulser\state.

The key file

The key file holds only the 43-character API key; surrounding spaces and line breaks are ignored. The agent refuses a key file that other users can access: on Linux and macOS it must not be readable by others or writable by its group (mode 0600 or 0640); on Windows, Everyone, Authenticated Users and Users must not be able to read it. The key is never written to logs, URLs or the state folder.

Everything else (upload interval, thresholds, alert timing) comes from LivePulser, not from this file. See Thresholds and alert timing.

Command-line flags

livepulser-agent [--config PATH] [--check] [--log-file PATH] [--verbose]
FlagWhat it does
-c, --config PATHThe configuration file to use. Defaults to the platform's configuration path (below).
--checkFetch and validate the monitor's configuration, print it, then exit. It prints the configuration version, upload and sample intervals, alert and recovery times with the recovery margin, status (active or paused), disk path and network interface.
--log-file PATHWrite logs to PATH instead of standard error. The file is rotated to PATH.1 at 1 MiB, so at most 2 MiB is used.
-v, --verboseAlso log debug messages, including every sample.
-V, --versionPrint the version and exit.
-h, --helpShow the help text.
--serviceWindows only. The Windows service manager uses it to run the agent as a service; you don't pass it yourself. It can't be combined with --check.

Without --check, the agent runs in the foreground until it's stopped. Under systemd, logs go to the journal.

Checking a configuration

Run --check after any change, as the agent's own user, so it reads the files with the same permissions as the service:

Linux
sudo -u livepulser-agent /usr/local/bin/livepulser-agent --config /etc/livepulser-agent/agent.conf --check
macOS
sudo -u _livepulser /usr/local/bin/livepulser-agent --config /usr/local/etc/livepulser-agent/agent.conf --check
Windows (elevated PowerShell)
& "C:\Program Files\LivePulser Agent\livepulser-agent.exe" --config C:\ProgramData\LivePulser\agent.conf --check

Each check fetches the configuration from LivePulser, and each monitor allows 12 configuration requests a minute. Example output and common failures are in Check the installation.

Exit codes

CodeMeaning
0Clean shutdown, or --check succeeded.
1Runtime failure, for example --check can't reach the endpoint.
77The API key was rejected at startup.
78Invalid configuration, an unreadable or invalid key file, an unsupported server configuration version, or another instance holds the state lock.

Don't restart the agent automatically after exit codes 77 or 78: fix the key or configuration first. The systemd unit doesn't restart on them. On Windows the service stops and stays stopped, and sc.exe query LivePulserAgent shows the code as a service-specific error. On macOS, launchd restarts the agent after any non-zero exit, at most once a minute.

A running agent doesn't exit when LivePulser can't be reached: it keeps its readings and retries. If its key is rejected while it's running, it stays running but stops sending until the key is reloaded.

Files, services and logs

LinuxmacOSWindows
Binary/usr/local/bin/livepulser-agent/usr/local/bin/livepulser-agentC:\Program Files\LivePulser Agent\livepulser-agent.exe
Configuration/etc/livepulser-agent/agent.conf/usr/local/etc/livepulser-agent/agent.confC:\ProgramData\LivePulser\agent.conf
API key file/etc/livepulser-agent/api-key/usr/local/etc/livepulser-agent/api-keyC:\ProgramData\LivePulser\api-key
State folder$STATE_DIRECTORY or /var/lib/livepulser-agent/usr/local/var/livepulser-agentC:\ProgramData\LivePulser\state
Servicesystemd unit livepulser-agentlaunchd daemon com.livepulser.agent (/Library/LaunchDaemons/com.livepulser.agent.plist)Windows service LivePulserAgent
Runs aslivepulser-agent_livepulserNT SERVICE\LivePulserAgent
Logsjournalctl -u livepulser-agent -f/usr/local/var/livepulser-agent/agent.logC:\ProgramData\LivePulser\state\agent.log

Owners and permissions are listed in Installed files. The state folder holds two files: state, with the session ID and a sequence reservation (never the API key), and agent.lock, which stops a second agent using the same state. Don't copy the state folder into machine images: every server needs its own monitor and its own session.

Key as a systemd credential (Linux)

Instead of a group-readable key file, you can keep the key readable by root only and let systemd pass it to the agent. Run sudo systemctl edit livepulser-agent and add:

systemctl edit livepulser-agent
[Service]
LoadCredential=api-key:/etc/livepulser-agent/api-key

Then remove the api_key_file line from agent.conf and restart the service. The agent reads $CREDENTIALS_DIRECTORY/api-key.

systemd hardening

The shipped unit already uses a strict systemd sandbox. Don't add these settings, because they hide the host data the agent measures:

  • PrivateNetwork=: the agent would only see an empty network namespace;
  • ProtectProc=invisible together with ProcSubset=pid: this hides /proc/stat and /proc/meminfo;
  • PrivateMounts= or TemporaryFileSystem= over the measured disk: the disk reading would describe the wrong filesystem.

Reloading the key

After you rotate a key in the dashboard, replace the contents of the key file and tell the agent to reload it:

PlatformReload command
Linuxsudo systemctl reload livepulser-agent
macOSsudo launchctl kill HUP system/com.livepulser.agent
Windowssc.exe control LivePulserAgent paramchange

The agent keeps its session across the reload. If LivePulser hasn't applied the new key yet, the agent logs that the key was rejected and stops sending; reload again a few seconds later. See Monitor keys.

Running without a service manager

The agent runs in the foreground, so any supervisor can run it. When you do:

  • run it as an unprivileged user;
  • give it a private state folder (state_dir=) owned by that user;
  • send SIGTERM (Ctrl+C on Windows) to stop it, and SIGHUP to reload the key;
  • don't restart it automatically after exit codes 77 or 78.

Updating and uninstalling

See Update the agent and Uninstall the agent.

How configuration reaches the agent

The agent fetches its monitor's settings from LivePulser: the upload interval, the sample interval, the thresholds, the alert and recovery rules, the disk path and network interface to measure, and whether the monitor is active or paused. It fetches them:

  • at startup,
  • whenever an upload response shows a newer configuration version,
  • every 60 seconds while the monitor is paused,
  • and once an hour as a safety net.

Dashboard changes therefore reach a running agent with its next upload, which can take up to one upload interval. The server can't change the endpoint, TLS settings or the files the agent reads.

Network and endpoints

  • The agent makes outbound HTTPS requests only, to the configured endpoint (normally https://rs.livepulser.com, port 443). It opens no listening ports and runs no commands.
  • It uses two endpoints: GET /v1/resource/<monitor-id>/config for configuration and POST /v1/resource/<monitor-id>/telemetry for readings.
  • Every request carries the key in an Authorization: Bearer <your-api-key> header, never in the URL, and identifies itself as livepulser-agent/<version>.
  • A request gives up after 3 seconds if it can't connect, and after about 10 seconds waiting for the response.
  • TLS verification is always on and can't be disabled. Redirects are never followed.

Responses the agent handles

ResponseWhat the agent doesWhat you should do
401Logs API key was rejected; replace the key file, then reload or restart the agent, and stops sending until the key is reloaded. At startup it exits with code 77.Check monitor_id, put the current key in the key file and reload.
403Logs telemetry refused; the monitor is paused or not provisioned. Drops buffered readings and re-checks its configuration.Resume the monitor if you want readings.
409Logs telemetry conflict; another agent may be using this monitor, and backs off. If the conflict lasts, it starts one new session.Make sure only one server uses this monitor ID and key.
413 / 422Drops the readings and logs the reason, including clock skew.If the log mentions the system clock, turn on time synchronisation (NTP).
429Waits at least 60 seconds before retrying.Nothing; the agent retries by itself.
5xx, network or TLS errorsBacks off (60, 120, 240, then 300 seconds, with jitter) and keeps the readings to send later.Check outbound HTTPS access to the endpoint, and the proxy and CA settings if you use them.
3xxNever followed; logged as a redirect refused, check endpoint.Set endpoint=https://rs.livepulser.com.

Readings that fail to upload are kept (up to 60 samples) and sent with the next upload; LivePulser ignores samples it has already counted, so retries never count twice.