Monitoring basics for your VPS

Good monitoring on a single server starts with tools already on the system, a traffic counter so you know where you stand against the included TB, and one outside check that tells you when the site is down. This guide sets up all three and shows when a full Prometheus and Grafana stack is worth it.

What should you watch on a small server?

Five numbers cover almost every problem: CPU load and steal time, available memory, disk space, disk I/O wait, and outgoing traffic. Add a list of failed services and one external check of your site, and you will notice nearly any trouble before your users do.

None of this needs an agent from a third party. The commands below ship with every image or are one package away, and they use almost no resources, so they run fine on P1.

How do you read load and CPU steal?

Start with uptime, which shows load averages over 1, 5 and 15 minutes. Compare them with the vCPU count from nproc: on a 2 vCPU plan, a load of 2 means the processors are fully busy, 4 means tasks are waiting.

Then check where CPU time goes:

vmstat 5 5

Read the last columns: us is your programs, sy the kernel, wa waiting for disk, and st steal, the time your virtual CPU was ready but the host ran something else. On shared vCPU plans a few percent of steal at busy hours is normal. If it stays above 10~15% while your app slows down, a dedicated CPU plan such as D8 removes it, because its threads are reserved for you.

top shows the same st value in its header line; htop with F2, Display options, Detailed CPU time does too.

How do you watch disk space and disk speed?

A full disk stops databases and logs without warning, so check space first:

df -h /
df -i /

The first line shows used space, the second the number of used inodes, which can run out with millions of tiny files even when space is left. Find what grew with du -xh / --max-depth=2 2>/dev/null | sort -h | tail -n 15, or install ncdu for an interactive view. Common culprits are /var/log, /var/lib/docker and old backups in the home folder.

For disk speed, install sysstat (apt install -y sysstat or dnf install -y sysstat) and run iostat -x 5. The %util column near 100 and a high r_await or w_await mean the disk is the bottleneck; on NVMe that usually points at a missing database index or swapping rather than the disk itself.

How do you track monthly traffic against your plan?

Install vnStat, which counts bytes per interface and keeps monthly totals across reboots:

apt install -y vnstat      # Ubuntu, Debian
dnf install -y vnstat      # Rocky, Alma (EPEL)
systemctl enable --now vnstat
vnstat -m

The tx column is outgoing traffic, which is what counts against the included amount; incoming rx is free. For example P4 includes 20 TB a month in Europe and 1 TB in North America, and extra traffic costs $0.72 per TB in Europe and North America or $4.98 per TB in Asia-Pacific and Sao Paulo. vnstat -d shows the daily trend, and vnstat -l shows live rates when you want to find out which moment is busy. For the culprit process, nethogs lists bandwidth per program.

How do you find failed services and errors in the logs?

systemd keeps track of every service. One command lists anything that crashed and did not come back:

systemctl --failed

It should say 0 loaded units listed. For a failed unit, systemctl status nginx shows its last lines and journalctl -u nginx --since "1 hour ago" the full log. To see only errors from the whole system since the last boot, use journalctl -p err -b.

Keep the journal from growing without limit by setting SystemMaxUse=500M in /etc/systemd/journald.conf and running systemctl restart systemd-journald. journalctl --disk-usage shows its current size.

How do you get an alert when something breaks?

Check from outside the server, since a server that is down cannot report itself. A free uptime monitoring service works, or a cron job on a second machine:

*/5 * * * * curl -fsS -m 10 https://example.com/health > /dev/null || curl -fsS -m 10 -d "example.com is down" https://chat.example.net/hook

The first curl fails on any error or timeout, and the second posts a message to a chat webhook. On the server itself, a small script catches slow problems such as a filling disk:

#!/bin/sh
USED=$(df --output=pcent / | tail -n 1 | tr -dc "0-9")
[ "$USED" -gt 85 ] && curl -fsS -d "web1 disk at $USED percent" https://chat.example.net/hook

Save it as /usr/local/bin/diskcheck, make it executable with chmod +x, and run it hourly from /etc/cron.d/diskcheck.

When are Prometheus and Grafana worth it?

When you run several servers, want history going back weeks, or need graphs to explain a slowdown after the fact. The Prometheus and Grafana image starts a monitoring server with dashboards ready. On each server you want to watch, install the node exporter:

apt install -y prometheus-node-exporter
systemctl enable --now prometheus-node-exporter
curl -s http://localhost:9100/metrics | head

Allow port 9100 only from the monitoring server IP in the firewall, then add the target in /etc/prometheus/prometheus.yml on the monitoring server. A small plan such as S4 is enough to keep months of metrics for a handful of machines.

What does a five-minute weekly check look like?

Once a week, log in and run, in order: uptime, free -h, df -h /, vnstat -m, systemctl --failed and journalctl -p err --since "7 days ago" | tail. Look at the trend, not one number: a disk that grows 2 GB a week, traffic that will pass the included amount before month end, or swap that is always used. Each of those gives you weeks of notice to clean up, tune, or move to the next plan size before anything breaks.

Questions about this guide

Is there a monitoring graph in the console?

The console handles power, rebuild, keys, invoices and tickets. For graphs, use the tools in this guide or the Prometheus and Grafana image on a separate server.

What is CPU steal and should I worry about it?

Steal is time your virtual CPU waited while the host served others. A little is normal on shared vCPU plans; if it stays high and hurts your app, Dedicated CPU plans reserve threads for you.

Does incoming traffic count against my included TB?

No. Only outgoing traffic counts. Incoming traffic, such as uploads to your server or packages you download, is free.

How do I know the server is up if I cannot SSH in?

Check the power state on the server page, then test from outside with ping 203.0.113.10 and nc -vz 203.0.113.10 22. If it is running but frozen, a reboot from the console usually brings it back.

Do monitoring tools slow the server down?

vnStat, sysstat and the node exporter use a few megabytes of RAM and almost no CPU. A full Grafana stack is heavier, which is why it runs best on its own server.