IT infrastructure monitoring: how to learn about outages before your staff do
If you learn about server problems from your employees, you effectively have no monitoring. I cover what a small company should track, how to set up alerts that people do not ignore, and how to choose between Zabbix and Prometheus.
Alexei Sergeev3 min read
The typical picture without monitoring: in the morning the accountant reports that the database will not open, and an investigation begins. It turns out the disk filled up overnight, the backup failed and the database stopped. All of this could have been seen in advance; the disk did not fill up in a single night.
The job of monitoring is not pretty charts but a timely warning about what needs attention before it becomes an outage.
What to track first
There is no need to start with hundreds of metrics. For a small infrastructure I begin with a short list that covers most real-world problems:
What
Why it matters
Free disk space
The most common reason databases and mail stop
Availability of key services (HTTP, mail, accounting system, VPN)
The server may be running while the service on it is not
Backup results
A backup that is not happening is only discovered when you try to restore
TLS certificate and domain expiry
An expired certificate breaks the website and mail at once
Internet link status
Especially with a backup link: you need to know when the office is running on it
Disk health (SMART) and RAID
A degraded array often goes unnoticed until the second failure
Load: CPU and memory
Helps explain slowdowns and plan for growth
A minimum set of checks for a small company.
Alerts that people do not ignore
The main mistake is too many notifications. If monitoring sends dozens of messages a day about short load spikes, people stop reading them within a week, and the important message drowns in the noise. A few rules I stick to:
Alert only on what requires action. Everything else goes on the charts.
Delay before firing. A problem should persist for a while (for example, 10 to 15 minutes) before a notification goes out.
Severity levels. "Disk space runs out in a week" and "server is down" are different events with different channels.
A convenient channel. Most often Telegram or email; what matters is that the alert reaches whoever will respond.
An example Prometheus rule: alert if a file system has less than 10% free space for more than 15 minutes.
alerts.yml
groups:
- name: base
rules:
- alert: DiskAlmostFull
expr: |
node_filesystem_avail_bytes{fstype!~"tmpfs|overlay"}
/ node_filesystem_size_bytes{fstype!~"tmpfs|overlay"} < 0.10
for: 15m
labels:
severity: warning
annotations:
summary: "Low disk space on {{ $labels.instance }} ({{ $labels.mountpoint }})"
Zabbix or Prometheus
Both tools are open source and free, and both suit businesses. The choice depends on what you need to watch:
Zabbix is convenient when there is a lot of classic infrastructure: servers, network equipment over SNMP, Windows machines, printers. It has many ready-made templates and is configured through a web interface.
Prometheus with Grafana fits Linux servers, containers and your own applications well. The configuration lives in files and is easy to keep in Git.
For a small company I usually pick one of them so as not to maintain two systems. Sometimes a simple external website availability check is added to the main monitoring, so you learn about a problem even if the whole office goes down together with the monitoring server.
Where to start
List what is critical for the company's work.
Add those hosts and services to monitoring with a minimum set of checks.
Send alerts to one clear channel and watch the noise for a week, adjusting thresholds.
Why a copy on the disk next door is not yet a backup, how to apply the 3-2-1 rule in a small company, and why a backup only counts as existing once a restore has been tested. With a restic example.
The minimum set of measures I apply to every new Linux server: key-only SSH login, a firewall, automatic security updates, brute-force protection and a check of open ports.
Why a flat network where every device sees every other one is the main source of trouble in a small office, and how to split it into VLANs on MikroTik with RouterOS 7: the layout, bridge configuration, firewall rules an…
Read →
This site can use Yandex Metrica for anonymised visit statistics. Allow it?
Learn more