Installing Zabbix 5.0 LTS on Amazon Linux 2

Contents

At work, we use Zabbix for monitoring alongside Pinpoint.
We mainly use it to monitor services running on instances and the URLs of important service domains. From the examples I have seen, though, Zabbix seems capable of much more. I want to install it myself to learn how to configure it, then gradually explore other ways to use it.

Initial Zabbix Installation

bash
timedatectl set-timezone Asia/Seoul

# Installation Zabibix RPM
rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/7/x86_64/zabbix-release-5.0-1.el7.noarch.rpm
yum clean all

# Installation additinal package
rpm -Uvh https://rpmfind.net/linux/centos/7.9.2009/extras/x86_64/Packages/centos-release-scl-rh-2-3.el7.centos.noarch.rpm
rpm -Uvh https://rpmfind.net/linux/centos/7.9.2009/extras/x86_64/Packages/centos-release-scl-2-3.el7.centos.noarch.rpm

# Installation additinal zabbix package
yum install zabbix-server-mysql zabbix-agent

Install Zabbix Components

bash
yum-config-manager --enable rhel-server-rhscl-7-rpms

* Enable the zabbix-frontend Repository (/etc/yum.repos.d/zabbix.repo)

Post image 1

bash
yum install zabbix-web-mysql-scl zabbix-nginx-conf-scl

Install MariaDB

bash
yum install -y mariadb mariadb-server
systemctl start mariadb && systemctl enable mariadb

mysql -u root -p
> create database zabbix character set utf8 collate utf8_bin;
> create user zabbix@localhost identified by 'password';
> grant all privileges on zabbix.* to zabbix@localhost;
> grant all privileges on *.* to 'root'@'%' identified by 'root';
> quit;

Import the Initial Zabbix Schema and Data

bash
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix

Configure PHP for the Zabbix Frontend

bash
vim /etc/opt/rh/rh-php72/php-fpm.d/zabbix.conf

Post image 2


Configure Zabbix Server

bash
vim /etc/zabbix/zabbix_server.conf

Post image 3

Configure nginx for Zabbix

Post image 4

Configure Services for Zabbix Server

bash
systemctl restart zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm
systemctl enable zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm mariadb
systemctl status zabbix-server zabbix-agent rh-nginx116-nginx rh-php72-php-fpm mariadb

Zabbix Server Initial Setup Screen

Post image 5

Zabbix Server Setup Complete Screen

Post image 6

I ran into more errors than expected during installation, but it worked in the end!




References

  1. https://www.zabbix.com/download?zabbix=5.0&os_distribution=centos&os_version=7&components=server_frontend_agent&db=mysql&ws=apache
  2. https://parkbrother.tistory.com/entry/최신-Amazon-Linux-2-Zabbix-Server-50-설치

Diagram

100%

Drag to pan; pinch or use the wheel to zoom. Keyboard: arrow keys pan, + − zoom, 0 fits, Esc closes. The same content is in “Read the diagram as text” below the figure.