# Get memory, disk space and load with the agent

> Your provider can tell us how busy a server is. It cannot tell us how much memory is left, how full the disk is, or which process is eating the machine…

Source: https://infranest.io/docs/install-the-server-agent
Last updated: 2026-09-19

---

Get memory, disk space and load readings from inside a server by installing the InfraNest agent — a small script for anyone who wants to be warned before a disk fills up or memory runs out.

## Overview

- Your provider can report how busy a server is, but not how much memory is free, how full the disk is, or which process is using the machine — those numbers only exist on the server itself.
- The InfraNest agent is a small script you install once. It sends those numbers to InfraNest every minute.
- You don't need it for CPU, network or disk throughput — those already work on supported providers with nothing installed.
- With it installed, you also get a reading every minute instead of every five, an alert if the server stops reporting altogether, the processes using the most CPU and memory, and a breakdown of what's filling up a disk.

## Install the agent

1. Choose **Install the agent**. You'll find it on the server's row in **Monitors**, in the server's actions menu, and beside any alert rule that's greyed out because it needs the agent — all three open the same window. There's nothing to fill in: a token is created as soon as the window opens.
<!-- screenshot: install-the-server-agent -->

<!-- docs-screenshots:start:install-the-server-agent -->

![Get memory, disk space and load with the agent](/media/8c082df7-08a0-49e2-9f90-5d8844fb3e63)

<!-- docs-screenshots:end:install-the-server-agent -->

2. The token is shown once. Below it is a ready-made install command with the token already filled in — pick the tab for your system (Ubuntu/Debian, CentOS/RHEL, or Windows) and copy it.
3. Optionally tick the option to also show which processes are using the most memory and CPU — the command above updates as you tick it. It's off by default: InfraNest only ever stores the program name, never the full command line, and turning it on later means editing a file on the server and restarting the agent.
4. Paste the command into a terminal on that server and run it. On Linux, run it as root or with `sudo`; on Windows, run PowerShell as Administrator.
5. Wait about a minute, then reload the page. The greyed-out alert rules become available, and the metrics view starts showing memory, disk space and load.

> [!NOTE]
> It only ever sends data out — it opens no port, listens for nothing, and can't be told to do anything. It sends numbers, not file contents, and it doesn't run as an administrator.

## Understand "Not accounted for" on the disk breakdown

1. Open the disk card for a server with the agent installed. It lists the biggest folders on the fullest disk.
2. If you see a line like "15.9 GB not accounted for", that means the agent wasn't allowed to read one or more folders (commonly `/var/lib/docker` or `/root`) — it isn't an error.
3. Check the named folders it couldn't read. If most of the disk sits in that unaccounted line, the list above it isn't the full answer to what's filling the disk.
4. Decide whether to grant access. For small system folders (`/etc/ssl/private`, `/etc/sudoers.d`, and similar), leave them alone — there's no good reason to open them up.
5. For a real data folder you want counted, give the `infranest-agent` user read and execute access to it; the next scan (within an hour) will include it.
6. For Docker specifically, it's usually faster to run `sudo docker system df` on the server to see the breakdown, and `sudo docker system prune` to reclaim unused space, rather than changing permissions.

## Alert me when a server goes quiet

1. Go to **Settings → Alert rules**.
2. Add an alert rule for a server going quiet (no data from the agent).
3. Choose how long the silence has to last before you're alerted.

> [!TIP]
> Give it a few minutes rather than one. The agent checks in about once a minute, so a one-minute deadline can trip on a perfectly healthy server. The shortest allowed is two minutes — ten is a more comfortable choice.

## How often it reports

- The agent takes a reading every 60 seconds, but how many of those are actually stored depends on your plan — lower plans keep one every few minutes, higher plans keep every reading.
- You don't need to configure this. InfraNest tells the agent its rate automatically, and extra readings are simply not stored rather than lost or retried.
- Your alert rules need a window long enough to hold a few readings. If your plan only stores one reading every five minutes, a rule needs more than five minutes to have anything to judge — InfraNest will tell you the minimum if you try to save a shorter one.

## What happens if the server can't reach InfraNest

- Nothing is lost straight away. The agent keeps its readings on the server and sends them once the connection returns.
- It holds about eight hours of readings, then starts discarding the oldest — it won't fill up your disk waiting.
- To check its status directly on the server, run `infranest-agent status`. It works even when nothing else does, since it doesn't need to contact InfraNest to answer.
- Two common answers: "InfraNest rejected this token" means the token was deleted in InfraNest — create a new one and re-run the installer. "This machine is about 8m ahead of InfraNest" means the server's clock is wrong; turn on time sync with `sudo timedatectl set-ntp true`.

## Turn off the agent

1. Open the server's monitoring Overview and find the **Agent** panel.
2. Delete the agent token there. The server goes straight back to provider metrics, and memory, disk-space and load rules stop being measured.
3. Optionally remove the script from the machine itself:
   - Linux: `sudo rm /etc/cron.d/infranest-agent /usr/local/bin/infranest-agent`
   - Windows (PowerShell, as Administrator): `Unregister-ScheduledTask -TaskName "InfraNest Agent"`, then delete `C:\ProgramData\infranest-agent.ps1`

## Tips

> [!TIP]
> You can read the install script before running it — it's short and plain, with nothing hidden.
