ubuntu 16.04 + zabbix 3.4 + zabbix proxy
os: ubuntu 16.04
zabbix: 3.4
ip 规划
192.168.56.101 node1 pgsql 9.6 master
192.168.56.102 node2 pgsql 9.6 slave
192.168.56.103 node3 zabbix proxy
192.168.56.104 node4 zabbix server
本篇blog介绍在 node3 节点上安装 zabbix proxy 的具体过程。
Choose your platform for Zabbix server
选定
zabbix version:3.4
os distribution:ubuntu
os version:16.04(Xenial)
database:mysql
https://www.zabbix.com/download?zabbix=3.4&os_distribution=ubuntu&os_version=xenial&db=MySQL
Install and configure Zabbix server
Install Repository with MySQL database
# wget https://repo.zabbix.com/zabbix/3.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.4-1+xenial_all.deb
# dpkg -i zabbix-release_3.4-1+xenial_all.deb
# apt update
Install Zabbix proxy
zabbix proxy 端没有安装 zabbix-agent
# apt install zabbix-proxy-mysql
# ls -l /etc/zabbix/
Create initial database
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> quit;
# zcat /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz | mysql -uzabbix -p zabbix
Configure the database for Zabbix server
# vi /etc/zabbix/zabbix_proxy.conf
Server=192.168.56.104
ServerPort=10051
Hostname=node3
LogFile=/var/log/zabbix/zabbix_proxy.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_proxy.pid
SocketDir=/var/run/zabbix
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=password
ConfigFrequency=10
DataSenderFrequency=10
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
CacheSize=256M
Timeout=4
ExternalScripts=/usr/lib/zabbix/externalscripts
FpingLocation=/usr/bin/fping
Fping6Location=/usr/bin/fping6
LogSlowQueries=3000
Start Zabbix server and agent processes
# systemctl restart zabbix-proxy
# systemctl enable zabbix-proxy
或者使用
# update-rc.d zabbix-proxy defaults 90
# netstat -antp|grep -i zabbix
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 8595/zabbix_proxy
tcp6 0 0 :::10051 :::* LISTEN 8595/zabbix_proxy
在web界面添加 zabbix proxy
Administration -> Proxies -> Create proxy -> Proxy
注意 Proxy name 必须与 zabbix proxy 节点 /etc/zabbix/zabbix_proxy.conf 文件的 Hostname 值相同。
Configuration -> Hosts -> Create host
然后添加 host 时,可以选择指定的 zabbix proxy。
参考:
https://www.zabbix.com/download
https://www.zabbix.com/documentation/3.4/manual
https://www.zabbix.com/documentation/3.4/manual/installation/install_from_packages