首先:安裝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/zabbixphp
補充一下agent的安裝和配置:node
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/mysql