1. 安装zabbix准备
本文采用操作系统:CentOS7.3 x64
需要epel源
wget https://mirrors.tuna.tsinghua.edu.cn/epel/epel-release-latest-7.noarch.rpm
rpm -ivh epel-release-latest-7.noarch.rpm
2. 下载zabbix rpm安装包
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-agent-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-get-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-proxy-mysql-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2.6-1.el7.noarch.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-sender3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-server-mysql-3.2.6-1.el7.x86_64.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-web-3.2.6-1.el7.noarch.rpm
wget http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-web-mysql-3.2.6-1.el7.noarch.rpm
3. 查看zabbix需要的安装包
yum install zabbix-*
4. 安装MysqL社区版官方版
wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
rpm -ivh MysqL-community-release-el7-5.noarch.rpm
yum install -y MysqL-community-server
5. 启动MysqL
systemctl enable MysqLd
systemctl start MysqLd
创建密码:
MysqL_secure_installation
MysqL -uroot -p
6. 创建zabbix数据库并授权
MysqL -uroot -p
MysqL> create database zabbix character set utf8 collate utf8_bin;
MysqL> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
MysqL> flush privileges;
MysqL> quit;
7. 导入zabbix数据库
zcat /usr/share/doc/zabbix-server-MysqL-3.2.6/create.sql.gz | MysqL -uzabbix -pzabbix -b zabbix
8. 修改zabbix配置,主要是zabbix数据库用户名和密码的设定
# vi /etc/zabbix/zabbix_server.conf
配置默认数据库用户名
DBUser=zabbix
DBPassword=zabbix
其他可以默认
9. 启动zabbix服务,并设置开机自启
systemctl enable zabbix-server
systemctl start zabbix-server
10. 编辑zabbix前端的PHP配置,更改下时区
vi /etc/httpd/conf.d/zabbix.conf
去掉时区前的#号,改一下位置
PHP_value date.timezone Asia/Shanghai
11. 启动apache服务,并设置开机自启
systemctl enable httpd
systemctl start httpd
12. 登录zabbix
13. 修改界面为中文,admin/语言改为ZH_CN.
14. 上传中文字体,msyh.ttf,然后上传到/usr/share/zabbix/fonts
第45行,将graphfont改为msyh
vi /usr/share/zabbix/include/defines.inc.PHP
15. agent客户端安装
(1) 其它客户端仅需要安装如下agent即可,5.x/6.x可以下载安装对应3.2.6-1rpm包。
rpm -ihv zabbix-agent-3.2.6-1.el7.x86_64
rpm -ihv zabbix-get-3.2.6-1.el7.x86_64.rpm
rpm -ihv zabbix-sender-3.2.6-1.el7.x86_64.rpm
最简单的只需要安装对应操作系统版本的agent包就可以了。
# vi /etc/zabbix/zabbix_agentd.conf
修改 :
Server=zabbix服务器地址
ServerActive=zabbix服务器地址
Hostname=你的客户端名称
(3) 配置agent服务以及配置开机自启动,注意开启防火墙10050端口。
systemctl enable zabbix-agent
systemctl start zabbix-agent
(4) 测试zabbix客户端情况
zabbix_get -s 192.168.1.90 -p 10050 -k "system.hostname"
client
16. 其它问题
解决默认(Template OS Linux)负载值不对问题:修改模板(Template OS Linux)--项目--Processor load (1、5、15 min average per core)键值:把 system.cpu.load[percpu,avg1] 改为 system.cpu.load[all,avg1] 把 system.cpu.load[percpu,avg5] 改为 system.cpu.load[all,avg5] 把 system.cpu.load[percpu,avg15] 改为 system.cpu.load[all,avg15]
原文链接:https://www.f2er.com/centos/377168.html