هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
$ مستخدم عادي# بصلاحية root (أو مع sudo)
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.
| Item | Value |
|---|---|
| Packages | zabbix-server-pgsql, zabbix-web-pgsql, zabbix-nginx-conf, zabbix-sql-scripts, zabbix-agent2 (+ zabbix-selinux-policy on RHEL) |
| Services | zabbix-server, zabbix-agent2, nginx, php-fpm |
| Configs | /etc/zabbix/zabbix_server.conf, /etc/zabbix/zabbix_agent2.conf, /etc/zabbix/web/ |
| Ports | 10051 (server, active agents), 10050 (agent, passive checks), 80/443 (web) |
| Database | PostgreSQL (or MySQL/MariaDB) |
| Versions | LTS releases (7.0) get 5 years of support — use LTS for production |
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 postgresqlInstall 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 postgresqlFirst 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:
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=change-me-long-random
CacheSize=256M
StartPollers=10Set the web server name (and later HTTPS with Certbot):
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 UI | Why |
|---|---|
New password for Admin; your own admin user; disable or remove guest access | Default credentials are public knowledge. |
| Users → Authentication: password policy (or LDAP/SAML SSO) | Strong logins. |
| Alerts → Media types → Email: your SMTP server | Problems reach people. |
| Users → your user → Media: email address + severity | Who gets which alerts. |
| Alerts → Actions → Trigger actions: enable "Report problems to Zabbix administrators" | The default action that sends the messages. |
Add hosts with Zabbix agent 2
On every Linux host (Zabbix repository as above):
dnf -y install zabbix-agent2
apt-get install -y zabbix-agent2Server=10.0.0.20
ServerActive=10.0.0.20
Hostname=web1.corp.example.comsystemctl 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 --reloadIn 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.
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_increaseIn 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.
Make it safe
Security checklist:
- Change
Admin/zabbixat 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,TLSPSKFilein 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.
Update and remove
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
| 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 connect | Firewall 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 log | Wrong 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 fast | Long history, too many items. | Lower history/trends days; disable unused items; housekeeping/partitioning. |
Next steps
- The modern metrics stack: Prometheus + Grafana (Grafana can also read Zabbix with a plugin).
- The database: PostgreSQL. The web server: Nginx. Email: Postfix.
- Simple uptime checks: Uptime Kuma.
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".