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)... 162.243.159.138, 2604:a880:1:20::b82:1001
Connecting to repo.zabbix.com (repo.zabbix.com)|162.243.159.138|: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;
Bye

导入数据库表结构

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

配置zabbix

改DB配置

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

DBPassword 改成 DBPassword=password

配置zabbix前端

[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

测试访问

打开网站

根据以下教程一步一步检查设置等信息进行相对应的调整
https://www.zabbix.com/documentation/5.0/manual/installation/install#installing_frontend

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

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

参考

Responses
  1. thanks a lot a great deal this web site is usually elegant plus simple

    Reply
  2. Hi i am kavin, its my first occasion to commenting anyplace, when i read this article i thought i could also make comment due to this good article.

    Reply
  3. Thanks for ones marvelous posting! I truly enjoyed reading it, you are a great author. I will be sure to bookmark your blog and will often come back later on. I want to encourage one to continue your great posts, have a nice holiday weekend!

    Reply
  4. Are you currently searching for escort girls in Tel Aviv ?18escortgirls can cause you to Want to pay quality young escort girls in your house or hotel? Trying to find Russian escorts, Ethiopian escorts or VIP escorts? Searching for escort services in Tel Aviv with the truly amazing way to obtain 18escortgirls Index can fulfill your entire fantasies discreetly.

    Reply
  5. While the physical mechanisms of cell motion have been effectively-studied (DiMilla et al., 1991; Sherratt and Murray, 1990; Murray, 2003; Maini et al., 2004), the complex regulation of the wound healing course of by biochemical signals and suggestions pathways remains poorly understood. The outcomes obtained in Avignon network are qualitatively the same as within the Manhattan network and might be summarized as follows: Applying the inflow regulation principle leads to much lower vehicle accumulations during and after the incident as gridlock results are suppressed and affected site visitors flows are inspired to take advantage of but free road capacities within the community. In the course of the incident itself, car accumulation is never balanced however additional will increase even with the inflow regulation precept utilized. In reality, the self-healing technique particularly depends on the inflow regulation which, regardless whether drivers are able to choose an alternative, all the time tries to maintain intersections passable for unaffected flows. The proposed self-healing strategy lowers the affect of traffic incidents in two methods: (i) inflow regulation and (ii) route revisions.

    Reply
  6. Definitely believe that which you said. Your favorite justification seemed to be on the net the simplest thing to be aware of. I say to you, I certainly get irked while people think about worries that they plainly do not know about. You managed to hit the nail upon the top as well as defined out the whole thing without having side effect , people can take a signal. Will probably be back to get more. Thanks

    Reply