本文采用操作系统: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
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
yum install zabbix-*
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
systemctl enable mysqld
systemctl start mysqld
创建密码:
mysql_secure_installation
mysql -uroot -p
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;
zcat /usr/share/doc/zabbix-server-mysql-3.2.6/create.sql.gz | mysql -uzabbix -pzabbix -b zabbix
# vi /etc/zabbix/zabbix_server.conf
配置默认数据库用户名
DBUser=zabbix
DBPassword=zabbix
其他可以默认
systemctl enable zabbix-server
systemctl start zabbix-server
vi /etc/httpd/conf.d/zabbix.conf
去掉时区前的#号,改一下位置
php_value date.timezone Asia/Shanghai
systemctl enable httpd
systemctl start httpd
http://xxx.xxx.xxx.xxx/zabbix
用户名Admin/zabbix
第45行,将graphfont改为msyh
vi /usr/share/zabbix/include/defines.inc.php
(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包就可以了。
(2) 修改配置文件
# 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]
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。