#:参考官方网站
https://www.zabbix.com/documentation/4.0/manual/installation/install_from_packages/debian_ubuntu

#:安装apt源

root@ubuntu:~# wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb

root@ubuntu:~# dpkg -i zabbix-release_4.0-2+bionic_all.deb

root@ubuntu:~# apt update

#:安装zabbix和zabbix前段

root@ubuntu:~# apt install zabbix-server-mysql
root@ubuntu:~# apt install zabbix-frontend-php
#:在MySQL服务器安装MySQL

root@ubuntu:~# apt install mysql-server -y

#:修改配置文件,修改监听端口

root@ubuntu:~# vim /etc/mysql/mysql.conf.d/mysqld.cnf
bind-address            = 0.0.0.0

#:启动MySQL

root@ubuntu:~# systemctl restart mysql

#:创建库,并授权用户

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'@'192.168.7.%' identified by "centos";
Query OK, 0 rows affected, 1 warning (0.00 sec)

#:在zabbix服务器导入表

zcat /usr/share/doc/zabbix-server-mysql/create.sql.gz
#:修改zabbix服务器的配置文件

root@ubuntu:~# vim /etc/zabbix/zabbix_server.conf
DBHost=192.168.7.106
DBName=zabbix
DBUser=zabbix
DBPassword=centos
DBPort=3306

#:启动服务

root@ubuntu:~# systemctl start zabbix-server
root@ubuntu:~# systemctl restart apache2

#:设置PHP

root@ubuntu:~# vim /etc/apache2/conf-enabled/zabbix.conf
 php_value date.timezone Asia/Shanghai

#:重启apache

root@ubuntu:~# systemctl restart apache2

访问

zabbix之二进制安装-LMLPHP

登录(默认账号和密码)

账号是Admin 密码是zabbix

#:在zabbix服务器安装一个客户端,让他先采集到自己的信息

root@ubuntu:~# apt install zabbix-agent

#:启动客户端

root@ubuntu:~# systemctl start zabbix-agent

查看

zabbix之二进制安装-LMLPHP

04-17 19:02