Before you install proxy, keep in mind that your proxy version must match the Zabbix server version!
$ zabbix_server -V |
# INSTALLING PACKAGES |
# Zabbix 5.0 LTS |
$ wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb |
$ dpkg -i zabbix-release_5.0-1+focal_all.deb |
# apt update |
OR |
# Zabbix 5.4 LATEST |
$ wget https://repo.zabbix.com/zabbix/5.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.4-1+ubuntu20.04_all.deb |
$ dpkg -i zabbix-release_5.4-1+ubuntu20.04_all.deb |
$ apt update |
$ apt-get install zabbix-proxy-mysql zabbix-sql-scripts |
# Install MariaDB |
$ sudo apt -y install mariadb-common mariadb-server mariadb-client |
$ systemctl start mariadb |
$ sudo systemctl enable mariadb |
# Create initial database |
$ mysql -uroot -p |
Enter password: <PRESS ENTER> |
mysql> create database zabbix character set utf8 collate utf8_bin; |
mysql> create user zabbix@localhost identified by ‘password’; |
mysql> grant all privileges on zabbix.* to zabbix@localhost; |
mysql> quit; |
# CREATING PROXY DATABASE |
$ zcat /usr/share/zabbix-proxy-mysql/schema.sql.gz | mysql -u zabbix zabbix -p |
Enter password: password |
OR |
$ zcat /usr/share/doc/zabbix-proxy-mysql/schema.sql.gz | mysql -u zabbix zabbix -p |
Enter password: password |
OR |
$ zcat /usr/share/doc/zabbix-sql-scripts/mysql/schema.sql.gz | mysql -u zabbix zabbix -p |
# STARTING ZABBIX PROXY PROCESS |
$ service zabbix-proxy start |
# DATABASE CONFIGURATION FOR ZABBIX PROXY |
$ vi /etc/zabbix/zabbix_proxy.conf |
DBHost=localhost |
DBName=zabbix |
DBUser=zabbix |
DBPassword=zabbix |
# Zabbix Server CONFIGURATION FOR ZABBIX PROXY |
Server=10.7.44.235 (IP ADDRESS OF ZABBIX SERVER) |
Hostname=Zabbix-proxy-1 |
# Start and enable proxy service |
$ sudo systemctl restart zabbix-proxy |
$ sudo systemctl enable zabbix-proxy |
# LOG FILE LOCATION |
/var/log/zabbix-proxy/zabbix_proxy.log |
or |
/var/log/zabbix/zabbix_proxy.log |
view rawzabbix-proxy-ubuntu-20.txt hosted with by GitHub
Understanding Zabbix proxy Active vs Passive mod
When you use a proxy in active mode, it will connect to the Zabbix server to retrieve configuration and send data. This is a great feature that enables active proxy server to work behind a firewall.
And if you use a proxy in passive mode Zabbix server will initiate a connection to the proxy to send configuration and retrieve data from the proxy.
Before, in this tutorial, we have configured proxy server to work in active mode. Let me show you how can you configure the proxy to work in passive mode.
Open file zabbix_proxy.conf with the command: “sudo nano /etc/zabbix/zabbix_proxy.conf” and turn on passive mode and define Zabbix server IP address by adding this anywhere in the file (change “Server” parameter to to match your Zabbix server):
ProxyMode=1
Server=10.7.44.235
Свежие комментарии