
Monitoring, part 5: Grafana — installation, Prometheus and Zabbix sources, ready-made dashboards and alerts
🌐 Machine-translated from Russian. Show original
In this part:
Step 1. Installation from the official repository#
Manufacturer's instructions: grafana.com/docs/.../installation/debian, download page: grafana.com/grafana/download.
sudo apt install -y apt-transport-https wget gnupg
sudo mkdir -p /etc/apt/keyrings
wget -q -O - https://apt.grafana.com/gpg.key | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg >/dev/null
echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] https://apt.grafana.com stable main" | sudo tee /etc/apt/sources.list.d/grafana.list
sudo apt update && sudo apt install -y grafana
sudo systemctl enable --now grafana-server
sudo ufw allow from 192.168.1.0/24 to any port 3000 proto tcp
Open http://192.168.1.11:3000, admin / admin login — Grafana will immediately ask you to change your password.
💡 The free version is Grafana OSS (
grafana). Thegrafana-enterprisepackage is also free without a license and works like OSS, with paid features included with a license key.
Step 2. Source Prometheus#
Connections → Data sources → Add → Prometheus → URL http://127.0.0.1:9090 → Save & test.
Step 3. Source: Zabbix#
sudo grafana cli plugins install alexanderzobnin-zabbix-app
sudo systemctl restart grafana-server
- Administration → Plugins → Zabbix → Enable.
- In Zabbix, create a user
grafanawith read-only role (User role with access to the required node groups) and an API token for it (Users → API tokens). - In Grafana: Data sources → Add → Zabbix → URL
http://127.0.0.1:8080/api_jsonrpc.php→ Auth type API token → token → Save & test.
Step 4. Ready-made dashboards#
Dashboards → New → Import → enter ID:
| ID | Dashboard | Source |
|---|---|---|
| 1860 | Node Exporter Full — all about the Prometheus | Linux server |
| 7587 | Blackbox Exporter — websites and certificates | Prometheus |
| — | Zabbix Server Dashboard, Zabbix System Status, | come with the plugin (Dashboards tab in source settings) |
Catalog: grafana.com/grafana/dashboards.
Step 5. Create your own dashboard "IT Health"#
One page for the manager and the duty officer:
| | Source and Query | panel
| --- | --- |
| Stat: how many problems now | Zabbix → Problems mode, importance ≥ High |
| Table: list of problems | Zabbix → Problems |
| Stat: availability of | Prometheus → avg(probe_success) | sites
| Bar gauge: disk filling | Prometheus → 100 - node_filesystem_avail_bytes / node_filesystem_size_bytes * 100 |
| Time series: internet channel traffic | Zabbix → router → incoming/outgoing WAN traffic |
| Stat: days until Prometheus | certificates expire → min((probe_ssl_earliest_cert_expiry - time()) / 86400) |
Tips:
- Variables (Dashboard settings → Variables) — a dropdown list of servers instead of dashboard copies.
- Threshold colors: green / yellow / red — obviously without legend.
- Fewer panels is better. If the dashboard doesn't fit on the screen, break it down.
Step 6. Alerts in Grafana#
Alerting → Contact points → Add → Telegram (bot token and chat ID). Then Alert rules → New — rule for any source, including data combinations.
Where to get alerts? Choose one spot for each type of problem, otherwise you'll get duplicates:
- infrastructure in Zabbix → Zabbix alerts;
- services in Prometheus → Alertmanager;
- Grafana alerts — for rules "over" multiple sources and business metrics from databases.
Step 7. Accesses#
- Organizations / Teams: the IT department sees everything, managers see only the consolidated dashboard.
- The default viewer is for new users.
- Login via LDAP/Active Directory:
/etc/grafana/ldap.tomland[auth.ldap] enabled = truetografana.ini. - Wall screen kiosk mode: add
?kioskto the dashboard address.
All that's left is to link everything into a single system: Monitoring, part 6: how Zabbix, Prometheus, and Grafana close each other's weak spots.
Comments · 0
No comments yet.Sign in to comment, rate and see all comments.