Background:
Two vps on vt only provide ipv6. (because it's cheap). My zabbix server is in Tencent cloud. It doesn't have ipv6. So I can't monitor them.
How about this? Think of a way... I have another vps to apply for ipv6. Because it's free.
https://www.tunnelbroker.net This website can use ipv6 in the way of ipv4 channel. As long as you apply for registration, you can get one free of charge.
Then you should install zabbix-proxy using mysql.
No crap, just paste the command/configuration file/code.
1. Install zabbix-proxy
wget https://repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb dpkg -i zabbix-release_4.0-2+bionic_all.deb apt update apt install zabbix-proxy-mysql
2. Database Related Processing
Create a new mysql database and authorize links.
create database zabbix_proxy character set utf8 collate utf8_bin; grant all privileges on zabbix_proxy.* to zabbix_proxy@localhost identified by 'zabbix_proxy'; flush privileges;
2.1 Import Table Structure
zcat /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz |mysql -uroot zabbix_proxy
3. Configure zabbix-proxy
Configuration file: / etc/zabbix/zabbix_proxy.conf
Server=118.xx.xx.xx Hostname=Zabbix proxy LogFile=/var/log/zabbix/zabbix_proxy.log LogFileSize=0 PidFile=/var/run/zabbix/zabbix_proxy.pid DBHost=localhost DBName=zabbix_proxy DBUser=zabbix_proxy DBPassword=zabbix_proxy SNMPTrapperFile=/var/log/snmptrap/snmptrap.log Timeout=4 ExternalScripts=/usr/lib/zabbix/externalscripts LogSlowQueries=3000
zabbix-server configuration
Locate to Management - > Agent Agent - > Create Agent. The main configuration options are as follows:
The agent agent agent name is the host name of your proxy configuration
Active mode of system proxy mode, representing proxy active link server. Active link proxy of passive mode server
Proxy address in active passive active mode is equivalent to whitelist, only specifying ip link passive mode needs to fill in proxyip and port correctly.
server creates actions to automatically add hosts
agent configuration linked to proxy
[root@vultr ~]# egrep -v '^#|^$' /etc/zabbix/zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=0 Server=2001:470:c:a11::2 StartAgents=3 ServerActive=2001:470:c:a11::2 Hostname=vt1 HostMetadataItem=system.hostname Include=/etc/zabbix/zabbix_agentd.d/*.conf
[root@vultr ~]# egrep -v '^#|^$' /etc/zabbix/zabbix_agentd.conf PidFile=/var/run/zabbix/zabbix_agentd.pid LogFile=/var/log/zabbix/zabbix_agentd.log LogFileSize=0 Server=2001:470:c:a11::2 StartAgents=3 ServerActive=2001:470:c:a11::2 Hostname=vt2 HostMetadataItem=system.hostname Include=/etc/zabbix/zabbix_agentd.d/*.conf
Automatically Added Successfully
Final relationship.
- vt2 and vt1 actively link proxy. transmit data (or two-way)
- proxy active link server transfers data (or two-way)
- vt2 and vt1 can not directly connect server s and can not directly transfer data.