基于Redhat8.5 部署zabbix5.4

仓库配置

本地源配置

mount /dev/sr0 /mnt    //先挂载


vim /etc/fatab    //编辑挂载文件 以便于开机自动挂载

/dev/sr0 /mnt iso9660 defaults 0 0


mount -a    


编辑yum 仓库   vim /etc/yum.repo.d/redhat.repo

[BaseOS]
name=baseos
baseurl=file:///mnt/BaseOS
gpgcheck=0

[AppStream]
name=AppStream
baseurl=file:///mnt/AppStream
gpgcheck=0
~           

编辑阿里云网络源  vim /etc/yum.repo.d/aliyun.repo

[Zabbix]
name=zabbix
baseurl=https://mirrors.aliyun.com/zabbix/zabbix/5.4/rhel/8/x86_64/
gpgcheck=0


yum makecache  //加载

安装zabbix5.4

dnf install https://mirrors.tuna.tsinghua.edu.cn/zabbix/zabbix/5.4/rhel/8/x86_64/zabbix-release-5.4-1.el8.noarch.rpm 

查看软件包

dnf list | grep ^zabbix

安装软件包

yum install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf.noarch httpd zabbix-agent2.x86_64  mariadb-server  zabbix-sql-scripts.noarch  zabbix-web-service.x86_64

启动数据库

systemctl enable --now mariadb

登录数据库

[root@localhost ~]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 8
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 

创建zabbix 用户以及zabbix 数据库

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by '123456';

导入zabbix 数据库

cd /usr/share/doc/zabbix-sql-scripts/mysql/
zcat create.sql.gz | mysql -uzabbix -p123456 zabbix

查看数据库表

[root@localhost yum.repos.d]# mysql
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 17
Server version: 10.3.28-MariaDB MariaDB Server

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use zabbix
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [zabbix]> show tables;

编辑配置文件

  vim /etc/zabbix/zabbix_server.conf

DBPassword=123456  //指定密码

vim /etc/php-fpm.d/zabbix.conf

php_value[date.timezone] = Asia/shanghai   // 指定时区

 启动服务

systemctl enable --now httpd.service php-fpm.service zabbix-server.service zabbix-agent2.service  zabbix-web-service.service 

使用浏览器访问服务

 检查是否全ok

 

 

 

 

 

 

解决zabbix 中文乱码的问题   cd 到这个目录下  或者使用find 命令找fonts文件位置   

[root@localhost dejavu]# pwd
/usr/share/fonts/dejavu
mv DejaVuSans.ttf DejaVuSans.ttf.bak

重windows  下找到字体文件  C:\Windows\Fonts    复制  一种字体(ttf结尾)

 复制到   linux  中的/usr/share/fonts/dejavu目录下  改名为DejaVuSans.ttf   刷新页面就OK了

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值