centos7.4 快速安装、配置zabbix3.4

前端之家收集整理的这篇文章主要介绍了centos7.4 快速安装、配置zabbix3.4前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。



目标:快速搭建zabbix使用环境,无需花费太多时间在安装上。通常公司招聘有zabbix需求的,zabbix应该都是已安装好的。

多熟悉功能比较好。


环境如下:

CentOS Linux release 7.4.1708 (Core) //最小化安装



初始化

//更新一次系统

yum update -y

//关闭selinux,关闭防火墙,重启

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

systemctl stop firewalld

systemctl disable firewalld

reboot

spacer.gif

wKioL1nNzTihOsEEAAEOQY3pTtM458.jpg-wh_50




安装,使用官方源进行安装

rpm -ivhhttp://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

//zabbix 基于Apache、MysqLPHP进行构建,所以需要安装httpd、MysqLPHP

//centos7使用mariadb取代MysqL,但操作命令都一样

yum install zabbix-server-MysqL zabbix-web-MysqL mariadb-server mariadb -y

//启动apache、mariadb

systemctl start httpd

systemctl enable httpd

systemctl start mariadb

systemctl enable mariadb

MysqL_secure_installation //MysqL初始化,设置密码,全部选Y

spacer.gif

wKioL1nNzWWhnpPkAAGS8HOoNKA160.jpg-wh_50




//创建zabbix数据库,zabbix用户、密码zabbix

//输入你刚刚设置的密码

MysqL -uroot -p

// 创建zabbix数据库,并设置编码为utf8,防止中文乱码

create database zabbix character set utf8 collate utf8_bin;

//创建zabbix用户给zabbix数据库,zabbix用户密码为zabbix

grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';

flush privileges;

spacer.gif

wKioL1nNzXWwM7vZAADHKDzyvDQ972.jpg-wh_50


//写入数据,需输入zabbix用户的密码zabbix

zcat /usr/share/doc/zabbix-server-MysqL-3.4.2/create.sql.gz |MysqL -uzabbix -p zabbix

spacer.gif

wKiom1nNzcTQmNIhAAFxzvbijq0046.jpg-wh_50



配置

//养成良好的习惯,修改文件先备份

cp /etc/zabbix/zabbix_server.conf{,.bak20170929}

vim /etc/zabbix/zabbix_server.conf

DBHost=localhost

DBName=zabbix

DBUser=zabbix

DBPassword=zabbix

spacer.gif

wKiom1nNzdXTisv0AAELOuX4hKI169.jpg-wh_50


//修改下时区

cp /etc/httpd/conf.d/zabbix.conf{,.bak20170929}

/etc/httpd/conf.d/zabbix.conf

PHP_value date.timezone Asia/Shanghai

spacer.gif

wKioL1nNzaTD2kKzAACM8d-yZrQ131.jpg-wh_50


//启动zabbix-server,并设置开机启动

systemctl start zabbix-server

systemctl enable zabbix-server


访问web页面:ip/zabbix

spacer.gif

wKiom1nNzgugHJSQAAC2FKdoRSs478.jpg-wh_50

wKioL1nNzcmSeSizAAB8PiJMREk654.jpg-wh_50

登录界面,默认的用户密码 Admin/zabbix

wKioL1nNzerwVZSMAABZTMJLVsM345.jpg-wh_50


设置中文

spacer.gif

wKiom1nNzjyQ2SV2AADduVLdHqQ355.jpg-wh_50



在被监控主机上安装zabbix-agent

yum update -y

sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

systemctl stop firewalld

systemctl disable firewalld

reboot

rpm -ivhhttp://mirrors.aliyun.com/zabbix/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

yum install zabbix-agent

cp /etc/zabbix/zabbix_agentd.conf{,.bak20170929}

vim /etc/zabbix/zabbix_agentd.conf

spacer.gif

wKiom1nNzlTzH5OyAACi75oiz5E709.jpg-wh_50


systemctl start zabbix-agent

systemctl enable zabbix-agent


//在页面添加主机

spacer.gif

wKioL1nNziDQWnuRAABNDn7IuoA777.jpg-wh_50

wKiom1nNzoPBfSgEAACqecfcXwY857.jpg-wh_50

wKioL1nNzkKzpikMAADKohB39QQ738.jpg-wh_50

wKioL1nNzkLACydrAAB-NYscVeY000.jpg-wh_50

wKioL1nNzmfgarHKAAC8tapmYqU090.jpg-wh_50

spacer.gif


等10分钟左右,到 监测中--图形那里去查看

spacer.gif

wKioL1nNzoPDOJ1bAAI0WTfZdrM229.jpg-wh_50



乱码解决

spacer.gif

wKiom1nNztXR2s3mAAAou14bY-g480.jpg-wh_50


将windows下的C:\Windows\Fonts\msyh.ttc 上传到zabbix-server /usr/share/zabbix/fonts 目录下

spacer.gif

wKioL1nNzqODBmE1AAAmW6KSJtw609.jpg-wh_50


替换字体

sed -i 's/graphfont/msyh/g' /usr/share/zabbix/include/defines.inc.PHP


spacer.gif

wKiom1nNzvGC5k94AABJA4Hn63I970.jpg-wh_50

原文链接:https://www.f2er.com/centos/375711.html

猜你在找的CentOS相关文章