Zabbix-监控端单实例部署

作为一名合格的云计算工程师,监控服务器的运行是必不可少的。
监控信息的收集方式
主动上报:优点是实时性比较好,缺点是消耗资源特别大。
被动监测:定时进行监测状态。
在这里插入图片描述

基本环境

zabbix-server 监控端一般单独装在一个服务器上(192.168.100.10)
官网:https://www.zabbix.com/documentation/3.2
环境:
IP 主机名角色
192.168.100.10 zabbix_server 监控服务器
192.168.100.20 web1 业务主机

Installing Zabbix packages

设置主机名: hostname zabbix_server
防火墙:systemctl stop firewalld.service
systemctl disable firewalld.service
selinux:setenforce 0

准备Zabbix-repo

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

安装Zabbix服务器

yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-get zabbix-agent    

zabbix-server-mysql:数据库
zabbix-web-mysql:WEB用来提供web页面
zabbix-get: 单命令行的查看工具
zabbi-agent:代理程序(上报信息的程序

Creating initial database

1.安装数据库

yum -y install mariadb mariadb-server

2.启动数据库

 systemctl start mariadb
 systemctl enable mariadb
(此处还需要在数据库中插入一些表用来存放监控的数据)

3.授权zabbix账号
mysql

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

4.初始化zabbix
注意3.2.的版本

[root@zabbix_server ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.3/
[root@zabbix_server zabbix-server-mysql-3.2.3]# zcat create.sql.gz | mysql -uroot -p zabbix

Starting Zabbix server process

配置sql账号密码:

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

此处注意:要使用搜索选项搜索内容,配置文件里有一些已经配置好的项目
启动zabbix

systemctl start zabbix-server.service 
systemctl enable zabbix-server.service 

修改时区Editing PHP configuration for Zabbix frontend

vim /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Shanghai 
(默认值,只需要配置时区。)
systemctl start httpd
systemctl enable httpd

欢迎页面:
在这里插入图片描述
PHP检测在这里插入图片描述
数据库信息
在这里插入图片描述
数据库信息报错:
在这里插入图片描述
服务器命名:
在这里插入图片描述
恭喜:
在这里插入图片描述
登录
用户名:Admin (区分大小写)
密码:zabbix

在这里插入图片描述
administration>users>admin user
右上角用户图标,更换语言

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
设置中文后,查看图形有乱码,文字变成了方块

界面乱码解决方法

在这里插入图片描述
解决方法:
Win+R打开运行,输入fonts,回车进入Windows字体目录,找到微软雅黑-常规字体,复制出来将文件名修改为msyh.ttf,注意后缀ttf

在这里插入图片描述
将msyh.ttf上传到服务器zabbix字体目录中:/usr/share/zabbix/fonts/

chmod 777  /usr/share/zabbix/fonts/msyh.ttf

查看字体配置

# grep FONT_NAME /usr/share/zabbix/include/defines.inc.php  -n

执行快捷替换:sed -i "s/graphfont/msyh/g"

/usr/share/zabbix/include/defines.inc.php

确认是否替换成功:

#grep FONT_NAME /usr/share/zabbix/include/defines.inc.php  -n

【45:define(‘ZBX_GRAPH_FONT_NAME’, ‘msyh’); // font file name】
【93:define(‘ZBX_FONT_NAME’, ‘msyh’);】

字体配置修改成功后,刷新图形界面即可看到图形字体显示正常了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值