首先:安装zabbix的repo库
yum install http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
其次:安装zabbix
yum install zabbix-server-mysql zabbix-web zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender
创建zabbix的数据库用户
create database zbxdb character set 'utf-8';
grant all on zbxdb to 'zbxuser'@'172.17.%.%' identified by 'zbxpass';
flush privileges;
导入zabbix的sql包
rpm -ql zabbix-server-mysql
cp /usr/share /doc/zabbix-server-mysql-3.4.4/create.sql.gz /root/
gzip -d create.sql.gz
mysql -uzbxuser -h172.17.254.111 -pzbxpass -d zbxdb< create.sql
登录瞅一下:
mysql -uzbxuser -h172.17.254.111 -pzbxpass
show databases;
配置server端:
vim /etc/zabbix/zabbix_server.conf
ListenPort=10051
DBHost=172.17.254.111 #要写数据库的IP
DBName=zbxdb
DBUser=zbxuser
DBPassword=zbxpass
启动server端:
systemctl start zabbix_server
修改时区:
vim /etc/php.ini
date.timezone = Asia/Shanghai
进入zabbix初始化:
http://ip/zabbix
补充一下agent的安装和配置:
agent安装:
yum install zabbix_agent zabbix_sender
配置agent:
vim /etc/zabbix/zabbix_agentd.conf
Server=172.17.254.111 #sever端IP
ListenIP=0.0.0.0
ServerActive=172.17.254.111
Hostname=node1 #本机hostname,不写识别不到
重启服务:
systemctl start zabbix-agent
在网页的server端添加agent:
Configuration/hosts/create host/
来源:51CTO
作者:村头沈师傅
链接:https://blog.51cto.com/13296640/2050722