متقدم
البحث فيأدلة التثبيت
طريقة البحث
  • الصق رسالة الخطأ بين علامتي تنصيص، مثل "permission denied"، لتجد جدول الحل.
  • اختر مجالًا وجزءًا من الدليل (التثبيت، أول الإعدادات، الاستخدام اليومي، الأمان، الحلول) لتصل مباشرة إلى الخطوة الصحيحة.
  • "كلمتان" تجد العبارة بالضبط.
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث
جرّب:

الدليل 82Zabbix · Monitoring

Install and set up Zabbix (server, network and app monitoring)

Zabbix is a complete, classic monitoring system: servers, network devices (SNMP), VMs, databases, web checks and apps — with agents, ready templates, graphs, maps, dashboards and alerting, all in one web UI. Many IT departments and service providers run it for their whole infrastructure. This guide installs Zabbix 7.0 LTS with PostgreSQL and Nginx on RHEL and Ubuntu, adds hosts with Zabbix agent 2, sets up email alerts, and covers security and the common errors.

  • 10 الدروس
  • 10 الأوامر

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

82.1

Know it before you install

The Zabbix server collects data from agents (on hosts), SNMP devices and other checks, stores it in a database, evaluates triggers (problem conditions) and runs actions (alerts). Templates bring ready items, triggers and graphs (for example "Linux by Zabbix agent"). The frontend is a PHP web app.

ItemValue
Packageszabbix-server-pgsql, zabbix-web-pgsql, zabbix-nginx-conf, zabbix-sql-scripts, zabbix-agent2 (+ zabbix-selinux-policy on RHEL)
Serviceszabbix-server, zabbix-agent2, nginx, php-fpm
Configs/etc/zabbix/zabbix_server.conf, /etc/zabbix/zabbix_agent2.conf, /etc/zabbix/web/
Ports10051 (server, active agents), 10050 (agent, passive checks), 80/443 (web)
DatabasePostgreSQL (or MySQL/MariaDB)
VersionsLTS releases (7.0) get 5 years of support — use LTS for production

الأوامر في هذا الدرس

82.2

Install on RHEL, Rocky and Alma

Add the Zabbix repository (copy the exact command for your OS and version from zabbix.com/download), and keep EPEL from offering its own Zabbix packages:

rpm -Uvh https://repo.zabbix.com/zabbix/7.0/rhel/9/x86_64/zabbix-release-latest-7.0.el9.noarch.rpm
dnf config-manager --save --setopt=epel.excludepkgs=zabbix*
dnf clean all
dnf -y install zabbix-server-pgsql zabbix-web-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent2 postgresql-server
postgresql-setup --initdb && systemctl enable --now postgresql

82.3

Install on Ubuntu and Debian

curl -fsSLO https://repo.zabbix.com/zabbix/7.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.0+ubuntu24.04_all.deb
dpkg -i zabbix-release_latest_7.0+ubuntu24.04_all.deb
apt-get update
apt-get install -y zabbix-server-pgsql zabbix-frontend-php php8.3-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent2 postgresql

الأوامر في هذا الدرس

82.4

First configuration: database, server, web

Create the database and import the schema:

sudo -u postgres createuser --pwprompt zabbix
sudo -u postgres createdb -O zabbix zabbix
zcat /usr/share/zabbix/sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix

(On some versions the schema is in /usr/share/zabbix-sql-scripts/postgresql/.) Tell the server the database password and size its caches:

/etc/zabbix/zabbix_server.conf (lines to change)
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=change-me-long-random
CacheSize=256M
StartPollers=10

Set the web server name (and later HTTPS with Certbot):

/etc/nginx/conf.d/zabbix.conf (first lines)
server {
    listen 80;
    server_name zabbix.example.com;
systemctl restart zabbix-server zabbix-agent2 nginx php-fpm
systemctl enable zabbix-server zabbix-agent2 nginx php-fpm
firewall-cmd --permanent --add-service={http,https} --add-port=10051/tcp
firewall-cmd --reload

(Ubuntu: the PHP service is php8.3-fpm; open the ports with ufw.) Open http://zabbix.example.com, finish the setup wizard (database password, time zone), and log in as Admin / zabbix — change this password at once (User settings → Change password).

First settings in the UIWhy
New password for Admin; your own admin user; disable or remove guest accessDefault credentials are public knowledge.
Users → Authentication: password policy (or LDAP/SAML SSO)Strong logins.
Alerts → Media types → Email: your SMTP serverProblems reach people.
Users → your user → Media: email address + severityWho gets which alerts.
Alerts → Actions → Trigger actions: enable "Report problems to Zabbix administrators"The default action that sends the messages.

82.5

Add hosts with Zabbix agent 2

On every Linux host (Zabbix repository as above):

dnf -y install zabbix-agent2
apt-get install -y zabbix-agent2
/etc/zabbix/zabbix_agent2.conf (lines to change)
Server=10.0.0.20
ServerActive=10.0.0.20
Hostname=web1.corp.example.com
systemctl enable --now zabbix-agent2
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="10.0.0.20" port port="10050" protocol="tcp" accept'
firewall-cmd --reload

In the UI: Data collection → Hosts → Create host: host name (same as Hostname), host group, interface "Agent" with the IP, template Linux by Zabbix agent. After a minute the ZBX icon turns green and data appears in Monitoring → Latest data. For many hosts use autoregistration (Alerts → Actions → Autoregistration) so agents add themselves.

82.6

Daily use: the commands and the real uses

systemctl status zabbix-server
tail -f /var/log/zabbix/zabbix_server.log
zabbix_server -R config_cache_reload
zabbix_get -s 10.0.1.11 -k system.cpu.load[all,avg1]
zabbix_agent2 -t vfs.fs.size[/,pfree]
zabbix_agent2 -R loglevel_increase

In the UI: Monitoring → Problems (what is wrong now), Dashboards, Maps, Maintenance periods (no alerts during planned work), Reports → Availability.

Real uses at work:

  • One tool for servers, switches/routers/firewalls (SNMP templates), printers, UPS, VMware and databases.
  • Web scenario checks (login and page checks) and SLA reports for management.
  • Many sites: Zabbix proxies collect data locally and send it to the central server.

82.7

Make it safe

Security checklist:

  • Change Admin/zabbix at once; no guest access; SSO or strong passwords with MFA.
  • HTTPS for the frontend (Nginx + Certbot); limit the UI to admin networks.
  • Encrypt agent traffic with PSK or certificates (TLSConnect, TLSAccept, TLSPSKFile in the agent config).
  • Firewall 10050 to the Zabbix server/proxy only; 10051 only from agents/proxies.
  • Database: own user, strong password, backups (pg_dump), housekeeping settings for history size.
  • Keep Zabbix on a supported LTS release; update agents too.

الأوامر في هذا الدرس

82.8

Update and remove

dnf -y upgrade 'zabbix-*'
apt-get install --only-upgrade -y 'zabbix-*'
systemctl restart zabbix-server zabbix-agent2

Minor updates (7.0.x) are package updates; a major upgrade (for example to the next LTS) changes the database — back up first and read the upgrade notes.

82.9

Fix common problems

ProblemCauseFix
Frontend: "Zabbix server is not running: the information displayed may not be current"Server stopped, or the web can not reach it.systemctl status zabbix-server; read zabbix_server.log (often a DB password error).
Host ZBX icon red: Get value from agent failed: cannot connectFirewall or agent not running.Open 10050 from the server; systemctl status zabbix-agent2.
Active checks fail: "host [web1] not found"Hostname in the agent does not match the host name in the UI.Make them exactly the same.
cannot connect to the database in the server logWrong DB settings or pg_hba.conf.Check DBPassword; test psql -h localhost -U zabbix zabbix.
"Zabbix value cache working in low memory mode"Cache too small.Raise ValueCacheSize/CacheSize; restart.
Database grows too fastLong history, too many items.Lower history/trends days; disable unused items; housekeeping/partitioning.

82.10

Next steps

1Active checks fail with "host not found". What do you check?

That Hostname in zabbix_agent2.conf is exactly the host name in the Zabbix UI.

2Which template do you link to a normal Linux server?

"Linux by Zabbix agent".

كل الأوامر في هذا الفصل