Skip to content

Instantly share code, notes, and snippets.

@devops-school
Last active August 19, 2022 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save devops-school/a5245cff7d94eaa10be2c5b7db3f9916 to your computer and use it in GitHub Desktop.
Save devops-school/a5245cff7d94eaa10be2c5b7db3f9916 to your computer and use it in GitHub Desktop.
Install and Configure Zabbix Proxy on Ubuntu 20.X
# You can check Zabbix server version with the command "zabbix_server -V":
$ 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment