Monitors

The server agent

The agent is a small program for Linux servers. Once a minute it sends the server's CPU, memory, disks, network and busiest processes to Uptimezy. It only sends: it opens no port and takes no commands.

On this page

What you need

  • Linux with systemd, on an x86-64 (amd64) or ARM64 processor.
  • A user who can run sudo, and curl on the server.
  • The server can open https://app.uptimezy.com over HTTPS. Nothing needs to reach the server: there is no port to open.

How many servers you can add depends on your plan: see the pricing page.

Install the agent

  1. On Servers, press Add server.
  2. Type a Name, such as Web server 1, and press Add server.
  3. A window shows the install command. It holds the server's token, which is shown only this once. Copy it, then press I copied it.
  4. On the server, paste the command into a terminal.
  5. The server shows Waiting until its first report, then Online, within a minute.

The command looks like this, with your server's token:

Shell
curl -fsSL https://app.uptimezy.com/api/v1/agent/install.sh | sudo sh -s -- --token agent_…
  • It downloads the agent to /usr/local/bin/uptimezy-agent.
  • It makes a system user uptimezy-agent, without a home directory or a login.
  • It writes the settings to /etc/uptimezy-agent/env: the address and the token. Only root and the agent's user can read this file.
  • It starts the service uptimezy-agent, which starts with the server and restarts by itself after 10 seconds if it stops.

To see that it runs, and its log:

Shell
systemctl status uptimezy-agent
journalctl -u uptimezy-agent

What the agent sends

The first report goes a few seconds after the agent starts, then one every minute, over HTTPS. The token travels in a header, never in the address.

WhatDetails
CPUAll cores together, from 0 to 100 %, since the last report.
LoadThe load average over 1, 5 and 15 minutes.
Memory and SwapUsed and total. Used memory is what programs hold: the total minus what is available.
DisksEach real filesystem once, such as ext4, xfs or btrfs, up to 30: where it is mounted, its type, used space and size. tmpfs, overlay and snap images are left out.
NetworkBytes per second in and out, all interfaces together except lo.
ProcessesHow many run, and the 10 busiest by CPU, with their memory. Names only.
SystemHost name, operating system, kernel, processor, CPU cores, memory, when it started, and the agent's version.

The agent reads /proc, /etc/os-release and the size of filesystems, nothing else. It reads a process's name, never its command line, because a command line can hold passwords. The reports are kept for 30 days.

What the agent can and cannot do

  • It runs as its own system user, not as root. Only the install needs root.
  • Its service makes the whole system read-only for it (ProtectSystem=strict), makes home directories read-only, and allows no new privileges.
  • systemd gives it at most 64 MB of memory and 10 % of one CPU core (MemoryMax=64M, CPUQuota=10%).
  • It only connects out, to https://app.uptimezy.com. It opens no port, takes no commands and runs no programs.
  • Its token starts with agent_. We keep only a hash of it, so it cannot be shown again.

See the server and get alerts

Servers lists every server with its Status, CPU, Memory, Fullest disk and Last report. A server that has not reported for 3 minutes shows Not reporting. A server's page shows Right now, charts Over time from 1 hour to 30 days, Disks, Busiest processes and System.

Alert rules

The first server of a workspace gets four rules, for all servers, so it is watched from its first minute:

RuleLimit
CPUAbove 90 % for 10 minutes
MemoryAbove 90 % for 10 minutes
Fullest diskAbove 85 % for 10 minutes
No reportNo report for 5 minutes
  1. On the server's page, under Alert rules, press Add rule.
  2. Under Watch, choose CPU, Memory, Swap, Fullest disk, Load or No report.
  3. Type the Limit: a percent from 1 to 100, or a load average. Choose how long it must last under For.
  4. Under Applies to, choose This server, All servers, or the servers with one tag.
  5. Press Add rule.
  • An alert opens when every report of that time is above the limit, and there are reports for at least 80 % of its minutes. It ends with the first report at or below the limit.
  • Load watches the load average of 1 minute. A server with 4 cores is fully busy at about 4.
  • A rule lasts from 1 minute to 1 day. No report needs at least 3 minutes, because the agent reports once a minute.
  • Before a No report alert, we ping the server's last address. The alert says whether it still answers: then the server is probably on, and the agent stopped or cannot reach us.
  • Alerts go to your email, chat apps and webhooks. A workspace can have up to 50 rules.

Update or remove the agent

To update the agent, run the install command again: it downloads the agent again and keeps the token that is in the command. The agent does not update itself.

The token is shown only once. If you did not keep the command, press New token on the server's page and run the new command. Or, on the server, take the token from the settings file:

Shell
sudo sh -c '. /etc/uptimezy-agent/env && curl -fsSL https://app.uptimezy.com/api/v1/agent/install.sh | sh -s -- --token "$AGENT_TOKEN"'

To take the agent off the server, run this there. The server's page shows it under Remove this server:

Shell
curl -fsSL https://app.uptimezy.com/api/v1/agent/install.sh | sudo sh -s -- --uninstall

It stops the service and removes it, the program, the settings and the agent's user. Pressing Remove server in the dashboard deletes the server and its minutes, and its token stops working, but it does not remove the agent from the machine: run the command too.

More guides

All guides