赞
踩
1.ubuntu自带的apt/sources.list不支持,先更改sources.list
vi /etc/apt/sources.list
将原本内容改为以下路径:
- deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
- deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
- deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
- deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
- deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
- deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
- deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
- deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
- deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
- deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
2.zabbix官网下载zabbix6.2
- wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1%2Bubuntu20.04_all.deb
- dpkg -i zabbix-release_6.2-1+ubuntu20.04_all.deb
- apt update
如果出现以下错误:
- N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'https://repo.zabbix.com/zabbix/6.2/ubuntu focal InRelease' doesn't support architecture 'i386'
编辑vi /etc/apt/sources.list.d/zabbix.list,添加[arch=amd64]
- deb [arch=amd64] https://repo.zabbix.com/zabbix/6.2/ubuntu focal main
- deb-src https://repo.zabbix.com/zabbix/6.2/ubuntu focal main
再更新ubuntu系统:apt update
3.安装Zabbix server,Web前端,agent
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
4.配置mysql
- apt install -y mysql-server
- mysql -uroot -ppassword
- mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
- mysql> create user zabbix@"%" identified by 'zabbix';
- mysql> grant all privileges on zabbix.* to zabbix@"%";
- mysql> set global log_bin_trust_function_creators = 1;
- mysql> quit;
5.更改zabbix时区
- vi /etc/zabbix/apache.conf
- php_value date.timezone Asia/Shanghai
6.zabbix数据库导入表
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
7.zabbix-server配置文件修改
- vi /etc/zabbix/zabbix_server.conf
- DBPassword=zabbix
8.启动Zabbix server和agent进程,并为它们设置开机自启
- systemctl restart zabbix-server zabbix-agent apache2
- systemctl enable zabbix-server zabbix-agent apache2
9.查看端口:netstat -lntp |grep zabbix
- root@zabbix:/etc/apt/sources.list.d# netstat -lntp |grep zabbix
- tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 25357/zabbix_agentd
- tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 25365/zabbix_server
- tcp6 0 0 :::10050 :::* LISTEN 25357/zabbix_agentd
- tcp6 0 0 :::10051 :::* LISTEN 25365/zabbix_server
10.登录http://localhost-ip/zabbix/setup.php进行网页配置
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。