Skip to main content
The install script installs the agent binary on Linux or macOS and runs it as a service. The AWS, Azure, Google Cloud and Oracle Cloud templates run the same script on the VMs they create.
Without AGENT_KEY it asks for the key on the terminal and hides what you type. To pass flags, add -s --:
Create the agent in Observer first (Agents, Add agent) to get its key. Observer shows it once.

What it does

  1. Picks the binary for the machine: Linux x86_64 or ARM64, macOS Apple silicon or Intel. Anything else exits with code 2; run the agent with Docker there.
  2. Downloads the binary and SHA256SUMS.txt from the agent’s GitHub release (with curl, or wget when curl is missing) and checks the binary’s SHA-256. On a mismatch it stops before writing anything.
  3. Installs the binary to /usr/local/bin/observer-agent.
  4. On Linux with systemd:
    • creates the system user observer-agent;
    • writes /etc/observer-agent/agent.env (mode 0600, readable by root only) with AGENT_KEY, CLOUD_SERVER_URL and BUFFER_PATH=/var/lib/observer-agent/observer-agent-buffer.db;
    • writes /etc/systemd/system/observer-agent.service and starts it.
    Run it as root, or as a user who can use sudo: it calls sudo for the steps that need root.
  5. On macOS: clears the quarantine flag on the binary, writes the LaunchAgent ~/Library/LaunchAgents/use.observer.agent.plist (mode 0600) and loads it. It starts at login and restarts if it exits. Logs go to ~/Library/Logs/observer-agent.log. Run the script as yourself, not with sudo; it asks for your password when it needs root to install the binary.
  6. On Linux without systemd (Alpine, most containers): installs the binary and prints the command to run it. On Alpine, install gcompat first (apk add gcompat libstdc++): the binary is built against glibc.
The unit and the plist are the same files the Add agent screen shows for the systemd and launchd targets.

Flags

Upgrades

Run the same command again. It replaces the binary and restarts the service. Without AGENT_KEY it keeps the existing agent.env (or plist) as it is, with the key, the Observer address and any variables you added. With AGENT_KEY it writes the file again with only the key, the Observer address and, on Linux, BUFFER_PATH: add your other variables again afterwards. --cloud-url only takes effect when the file is written, so pass it together with AGENT_KEY.

Settings

On Linux, add environment variables, such as PROMETHEUS_SERVER_URL or the secrets that probes reference by name, to /etc/observer-agent/agent.env, then restart:
On macOS, add them to the plist’s EnvironmentVariables and load it again, as in Install from a release binary.

Logs

  • Linux: journalctl -u observer-agent -f
  • macOS: tail -f ~/Library/Logs/observer-agent.log

Exit codes