Ubuntu 安装 zabbix (nginx版本)


Ubuntu 18.04 安装的 zabbix 版本为 5.0,下载步骤 按照 zabbix 官网的教程,也可以根据不同的环境进行切换

安装 zabbix


[root@Ubuntu:~]# wget https://repo.zabbix.com/zabbix/4.5/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.5-1+bionic_all.deb
--2020-03-04 17:30:54--  https://repo.zabbix.com/zabbix/4.5/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.5-1+bionic_all.deb
Resolving repo.zabbix.com (repo.zabbix.com)..., 2604:a880:1:20::b82:1001
Connecting to repo.zabbix.com (repo.zabbix.com)||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4136 (4.0K) [application/octet-stream]
Saving to: ‘zabbix-release_4.5-1+bionic_all.deb’

zabbix-release_4.5-1+bio 100%[==================================>]   4.04K  --.-KB/s    in 0s      

2020-03-04 17:30:55 (409 MB/s) - ‘zabbix-release_4.5-1+bionic_all.deb’ saved [4136/4136]

[root@Ubuntu:~]# dpkg -i zabbix-release_4.5-1+bionic_all.deb 
Selecting previously unselected package zabbix-release.
(Reading database ... 140455 files and directories currently installed.)
Preparing to unpack zabbix-release_4.5-1+bionic_all.deb ...
Unpacking zabbix-release (1:4.5-1+bionic) ...
Setting up zabbix-release (1:4.5-1+bionic) ...

[root@Ubuntu:~]# apt update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:2 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease [20.8 kB]
Fetched 7,525 kB in 3s (2,359 kB/s)                     
Reading package lists... Done
Building dependency tree       
Reading state information... Done
27 packages can be upgraded. Run 'apt list --upgradable' to see them.

安装zabbix server,前端,代理

[root@Ubuntu:~]# apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-agent
Reading package lists... Done
Building dependency tree       
Reading state information... Done


mysql> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> quit;


[root@Ubuntu:/]# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password: 



[root@Ubuntu:/]# vim /etc/zabbix/zabbix_server.conf 

DBPassword 改成 DBPassword=password


[root@Ubuntu:/]# vim /etc/zabbix/nginx.conf 

server_name 和 端口号相关的改成自己想要的配置

启动Zabbix server和agent进程

启动Zabbix server和agent进程,并为它们设置开机自启:

[root@Ubuntu:/]# systemctl restart zabbix-server zabbix-agent nginx php7.2-fpm
[root@Ubuntu:/]# systemctl enable zabbix-server zabbix-agent nginx php7.2-fpm
Synchronizing state of zabbix-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-server
Synchronizing state of zabbix-agent.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable zabbix-agent
Synchronizing state of nginx.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable nginx
Synchronizing state of php7.2-fpm.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable php7.2-fpm




最后systemctl enable zabbix-server和agent,zabbix-server可能需要重启机器才能启动

/* 在途中遇到很多错误排查,后续会更新出来


  1. Fantastic blog! Do you have any tips for aspiring writers? I'm planning to start my own site soon but I'm a little lost on everything. Would you propose starting with a free platform like Wordpress or go for a paid option? There are so many options out there that I'm totally overwhelmed .. Any ideas? Thank you!

  2. I must thank you for the efforts you have put in penning this site. I am hoping to check out the same high-grade content by you in the future as well. In truth, your creative writing abilities has inspired me to get my own blog now ;)

  3. It's an awesome piece of writing designed for all the web viewers; they will obtain advantage from it I am sure.

  4. It's remarkable for me to have a web page, which is useful in support of my knowledge. thanks admin

  5. great put up, very informative. I ponder why the other experts of this sector don't notice this. You must continue your writing. I'm confident, you have a great readers' base already!

  6. Great post. I used to be checking constantly this weblog and I am impressed! Extremely useful info specifically the last part :) I take care of such info much. I used to be looking for this certain info for a very long time. Thanks and best of luck.