搭建zabbix5.0lts,自己做个笔记

搭建zabbix 按照官方的文档

以下是直接复制官网的首页部分,选的是版本zabbix 5.0 LTS

Install and configure Zabbix server for your platform

~~~~注意点:::::::::::::::::::::::::::::: 必须要做的~

首先要关闭自带的防火墙,还有内核防火墙

systemctl disble --now firewalld.service
sudo vim /etc/selinux/config

将SELINUX=enforcing改为SELINUX=disabled即可

~~~~~注意点:::::::::::::::::::::::::::::::

a. Install Zabbix repository

# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
# yum clean all

b. Install Zabbix server and agent

# sudo yum install zabbix-server-mysql zabbix-agent

c. Install Zabbix frontend

Enable Red Hat Software Collections

# yum install centos-release-scl

centos-release-sc的用途是可以把多个版本的软件共存于centos 上,安装多个版本的软件不会破坏系统的依赖

Edit file /etc/yum.repos.d/zabbix.repo and enable zabbix-frontend repository.

[zabbix-frontend]
...
enabled=1
...

开启zabbix的前端源

Install Zabbix frontend packages.

# yum install zabbix-web-mysql-scl zabbix-apache-conf-scl

安装数据库

sudo yum install mariadb*
sudo systemctl enable --now mariadb.service
sudo mysql_secure_installation

d. Create initial database

Make sure you have database server up and running.
Run the following on your database host.

# mysql -uroot -p
password   #这是你刚才执行mysql_secure_installation设置的密码
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;

On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.

# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

e. Configure the database for Zabbix server

Edit file /etc/zabbix/zabbix_server.conf

DBPassword=password   #你要设置的密码

f. Configure PHP for Zabbix frontend
Edit file /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf, uncomment and set the right timezone for you.

; php_value[date.timezone] = Europe/Riga

g. Start Zabbix server and agent processes
Start Zabbix server and agent processes and make it start at system boot.

# systemctl restart zabbix-server zabbix-agent httpd rh-php72-php-fpm
# systemctl enable zabbix-server zabbix-agent httpd rh-php72-php-fpm

h. Configure Zabbix frontend
Connect to your newly installed Zabbix frontend: http://server_ip_or_name/zabbix
Follow steps described in Zabbix documentation: Installing frontend

解决zabbix-server 服务端默认乱码的问题

在这里插入图片描述
可以看到图中框框的图示
1.安装字体 sudo yum install wqy-microhei-fonts -y
2.sudo cp /usr/share/fonts/wqy-microhei/wqy-microhei.ttc /usr/share/fonts/dejavu/DejaVuSans.ttf 乱码问题解决。

踩过的坑

安装zabbix 的时候,我把web服务器选择为了nginx,但是装好后不能打开前端页面,选择了apache之后可以打开前端页面了。

以下是zabbix 的官网

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值