当前位置:   article > 正文

Ubuntu20.04搭建zabbix6.2_ubuntu zabbix

ubuntu zabbix

1.ubuntu自带的apt/sources.list不支持,先更改sources.list

vi /etc/apt/sources.list

将原本内容改为以下路径: 

  1. deb http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
  2. deb http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
  3. deb http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
  4. deb http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
  5. deb http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse
  6. deb-src http://mirrors.163.com/ubuntu/ focal main restricted universe multiverse
  7. deb-src http://mirrors.163.com/ubuntu/ focal-security main restricted universe multiverse
  8. deb-src http://mirrors.163.com/ubuntu/ focal-updates main restricted universe multiverse
  9. deb-src http://mirrors.163.com/ubuntu/ focal-proposed main restricted universe multiverse
  10. deb-src http://mirrors.163.com/ubuntu/ focal-backports main restricted universe multiverse

2.zabbix官网下载zabbix6.2

  1. wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1%2Bubuntu20.04_all.deb
  2. dpkg -i zabbix-release_6.2-1+ubuntu20.04_all.deb
  3. apt update

如果出现以下错误:

  1. 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]

  1. deb [arch=amd64] https://repo.zabbix.com/zabbix/6.2/ubuntu focal main
  2. 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

  1. apt install -y mysql-server
  2. mysql -uroot -ppassword
  3. mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
  4. mysql> create user zabbix@"%" identified by 'zabbix';
  5. mysql> grant all privileges on zabbix.* to zabbix@"%";
  6. mysql> set global log_bin_trust_function_creators = 1;
  7. mysql> quit;

5.更改zabbix时区

  1. vi /etc/zabbix/apache.conf
  2. 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配置文件修改

  1. vi /etc/zabbix/zabbix_server.conf
  2. DBPassword=zabbix

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

  1. systemctl restart zabbix-server zabbix-agent apache2
  2. systemctl enable zabbix-server zabbix-agent apache2

9.查看端口:netstat -lntp |grep zabbix

  1. root@zabbix:/etc/apt/sources.list.d# netstat -lntp |grep zabbix
  2. tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 25357/zabbix_agentd
  3. tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 25365/zabbix_server
  4. tcp6 0 0 :::10050 :::* LISTEN 25357/zabbix_agentd
  5. tcp6 0 0 :::10051 :::* LISTEN 25365/zabbix_server

10.登录http://localhost-ip/zabbix/setup.php进行网页配置

 

 

 

 

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/881791
推荐阅读
相关标签
  

闽ICP备14008679号