0

zabbix_proxy

Install and Configure Zabbix Proxy on Ubuntu 20.x

29.05.2023

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

This image has an empty alt attribute; its file name is zabbix-setup-docker-1-1.jpg

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

Свежие комментарии

Подписка

Лучшие статьи


Fatal error: Uncaught Error: Call to a member function have_posts() on null in /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/inc/blog.php:380 Stack trace: #0 /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/widgets/latest-posts/widget.php(257): fox56_blog_grid(NULL, Array) #1 /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/widgets/latest-posts/register.php(33): include('/home/host18670...') #2 /home/host1867038/the-devops.ru/htdocs/www/wp-includes/class-wp-widget.php(394): Wi_Widget_Latest_Posts->widget(Array, Array) #3 /home/host1867038/the-devops.ru/htdocs/www/wp-includes/widgets.php(837): WP_Widget->display_callback(Array, Array) #4 /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/inc/single.php(417): dynamic_sidebar('sidebar') #5 /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/inc/single.php(136): fox56_single_sidebar() #6 /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/inc/single.php(7): fox56_single_inner() #7 /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/single.php(23): fox56_single() #8 /home/host1867038/the-devops.ru/htdocs/www/wp-includes/template-loader.php(106): include('/home/host18670...') #9 /home/host1867038/the-devops.ru/htdocs/www/wp-blog-header.php(19): require_once('/home/host18670...') #10 /home/host1867038/the-devops.ru/htdocs/www/index.php(17): require('/home/host18670...') #11 {main} thrown in /home/host1867038/the-devops.ru/htdocs/www/wp-content/themes/fox/inc/blog.php on line 380