前提條件:html
配置agent服務器:python
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
yum clean all
yum -y install zabbix-agent
修改配置文件mysql
vi /etc/zabbix/zabbix_agentd.conf sql
Server=10.0.10.34
ListenPort=10050
StartAgents=1
ServerActive=10.0.10.34
Hostname=10.0.10.36
Timeout=30
UnsafeUserParameters=1
開啓服務數據庫
systemctl start zabbix-agent
進入Web進行配置bash
配置完成SNMP後,須要等待很長時間~~~~~~~服務器
配置proxyspa
因爲proxy須要各類依賴包,因此直接安裝一下server,能夠解決全部依賴包的問題。3d
rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm yum clean all yum -y install zabbix-proxy
安裝數據庫:代理
create database zabbix character set utf8 collate utf8_bin; #建立一個zabbix的數據庫 CREATE USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456'; GRANT ALL ON zabbix.* TO 'zabbix'@'localhost' WITH GRANT OPTION; #授予zabbix的本地登陸權限。 flush privileges; #刷新權限
導入proxy數據表:
zcat /usr/share/doc/zabbix-proxy-mysql-4.0.5/schema.sql.gz | mysql -uzabbix -p zabbix
配置conf文件
vi /etc/zabbix/zabbix_proxy.conf
Server=10.0.10.35 Hostname=10.0.10.34 DBHost=10.0.10.34 DBName=zabbix DBUser=zabbix DBPassword=123456
啓動proxy
systemctl start zabbix-proxy
查看端口是否已經開啓,模式爲10051
netstat -atunlp #沒有裝:yum install net-tools
修改agent的server和activeserver
Server=10.0.10.34 ServerActive=10.0.10.34
登陸server添加proxy
配置主機時,使用proxy代理便可。