Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Редакция КоммитРедакция портала
commit 509ff50 · 18 days ago

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). The grafana-enterprise package 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#

Zabbix plugin for Grafana:

sudo grafana cli plugins install alexanderzobnin-zabbix-app
sudo systemctl restart grafana-server
  1. Administration → Plugins → Zabbix → Enable.
  2. In Zabbix, create a user grafana with read-only role (User role with access to the required node groups) and an API token for it (Users → API tokens).
  3. 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:

IDDashboardSource
1860Node Exporter Full — all about the PrometheusLinux server
7587Blackbox Exporter — websites and certificatesPrometheus
—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.toml and [auth.ldap] enabled = true to grafana.ini.
  • Wall screen kiosk mode: add ?kiosk to 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 00 участников · 2 гостя🔒 Rate and discuss after signing up

Comments · 0

No comments yet.Sign in to comment, rate and see all comments.