Agent install

Install and configure the ServerMetry monitoring agent on Linux, macOS, and Windows.

View as Markdown

The ServerMetry agent is a lightweight Python 3.8+ process with no third-party dependencies. It collects CPU, memory, disk, network, and process metrics and posts them to the API (default: once per minute).

Tip: After you add a server in the dashboard, ServerMetry shows the exact install command with your API key pre-filled.

Linux / macOS

Always download and review install scripts before running them with elevated privileges.

# 1. Download
curl -fsSL https://raw.githubusercontent.com/FloBaMedia/servermetry-client/main/agent/install.sh -o /tmp/install.sh

# 2. Review
cat /tmp/install.sh

# 3. Install (production API)
chmod +x /tmp/install.sh
SERVERMETRY_URL=https://api.servermetry.com SERVERMETRY_KEY=sp_live_... sudo /tmp/install.sh

Interactive install (prompts for URL and key):

curl -fsSL https://raw.githubusercontent.com/FloBaMedia/servermetry-client/main/agent/install.sh -o /tmp/install.sh
chmod +x /tmp/install.sh
sudo /tmp/install.sh

Windows (PowerShell as Administrator)

Invoke-WebRequest -Uri 'https://raw.githubusercontent.com/FloBaMedia/servermetry-client/main/agent/install-windows.ps1' -OutFile $env:TEMP\install-servermetry.ps1
Get-Content $env:TEMP\install-servermetry.ps1
& $env:TEMP\install-servermetry.ps1 -ApiUrl "https://api.servermetry.com" -ApiKey "sp_live_..."

Install Python for all users so the Scheduled Task running as SYSTEM can execute it.

Install paths

Linux / macOSWindows
Install dir/etc/servermetry/C:\ProgramData\ServerMetry\
Config/etc/servermetry/agent.confC:\ProgramData\ServerMetry\agent.conf
Log/var/log/servermetry-agent.logC:\ProgramData\ServerMetry\agent.log
Schedulercrontab (* * * * *)Scheduled Task (every 1 min)
Runs asrootSYSTEM

Configuration

Config file:

[servermetry]
api_url = https://api.servermetry.com
api_key  = sp_live_...
debug    = false

Environment variables (override the config file):

VariableDescription
SERVERMETRY_API_URLAPI base URL
SERVERMETRY_API_KEYServer API key
SERVERMETRY_DEBUGSet to 1 for debug logging

Legacy SERVERPULSE_* names are still accepted.

Remote configuration

On each run the agent fetches GET /api/v1/agent/config and can apply timezone, locale, NTP, DNS, report interval, and auto-update settings from the dashboard Config tab.

Useful CLI flags

python agent.py --dry-run          # print metrics as JSON, no HTTP
python agent.py --debug            # verbose stderr logging
python agent.py --no-apply-config  # skip remote config

Source and uninstall scripts: servermetry-client on GitHub.