Zabbix4.0安装部署

文章目录

  • Zabbix安装部署
    • zabbix4.0:
      • 仓库源:
      • 下载:
      • 数据库环境搭建:
      • 导入数据:
      • 修改配置:
      • 启动服务:
      • 访问安装页面:
      • 安装时区问题:
        • 解决方案:
        • 遇到连接不上MySQL?

Zabbix安装部署

zabbix4.0:

仓库源:

rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/4.0/rhel/7/$basearch/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch 
baseurl=http://repo.zabbix.com/non-supported/rhel/7/$basearch/
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX
gpgcheck=1

这是官方仓库,有点慢可自行换国内的源。

下载:

yum-config-manager --enable rhel-7-server-optional-rpms
yum install zabbix-server-mysql
yum install zabbix-proxy-mysql
yum install zabbix-web-mysql
yum install zabbix-agent

[root@docker ~]# yum list | grep ^zabbix
zabbix-agent.x86_64                         4.0.47-1.el7               @zabbix  
zabbix-proxy-mysql.x86_64                   4.0.47-1.el7               @zabbix  
zabbix-release.noarch                       4.0-1.el7                  installed
zabbix-server-mysql.x86_64                  4.0.47-1.el7               @zabbix  
zabbix-web.noarch                           4.0.47-1.el7               @zabbix  
zabbix-web-mysql.noarch                     4.0.47-1.el7               @zabbix  
zabbix-get.x86_64                           4.0.47-1.el7               zabbix   
zabbix-java-gateway.x86_64                  4.0.47-1.el7               zabbix   
zabbix-proxy-pgsql.x86_64                   4.0.47-1.el7               zabbix   
zabbix-proxy-sqlite3.x86_64                 4.0.47-1.el7               zabbix   
zabbix-release.noarch                       4.0-2.el7                  zabbix   
zabbix-sender.x86_64                        4.0.47-1.el7               zabbix   
zabbix-server-pgsql.x86_64                  4.0.47-1.el7               zabbix   
zabbix-web-japanese.noarch                  4.0.47-1.el7               zabbix   
zabbix-web-pgsql.noarch                     4.0.47-1.el7               zabbix  

数据库环境搭建:

mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create database zabbix;
mysql> grant all on zabbix.* to zabbix@localhost;

导入数据:

[root@docker zabbix-proxy-mysql-4.0.47]# zcat create.sql.gz | mysql -uzabbix -pzabbix zabbix

修改配置:

vim /etc/zabbix/zabbix_server.conf 
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix

启动服务:

netstat -lnutp| grep zabbix
tcp        0      0 0.0.0.0:10051           0.0.0.0:*               LISTEN      3351/zabbix_server  
tcp6       0      0 :::10051                :::*                    LISTEN      3351/zabbix_server 

访问安装页面:

http://192.168.110.145/zabbix/setup.php

Zabbix4.0安装部署_第1张图片

安装时区问题:

image-20230802223206808

解决方案:

vim /etc/httpd/conf.d/zabbix.conf
#内容将时区修改为上海
php_value date.timezone Asia/Shanghai

遇到连接不上MySQL?

将localhost替换为127.0.01即可。

Zabbix4.0安装部署_第2张图片

用户:Admin 密码:zabbix

若界面为英文按一下操作切换中文:

image-20230802230240232

Zabbix4.0安装部署_第3张图片

你可能感兴趣的:(Web,zabbix)