Zabbix 5 installation on CentOS 8

CentOS-8.2.2004Zabbix-5.0.3PostgreSQL-12.4

This is an introduction memo for CentOS 8 of a condition monitoring solution called Zabbix. The configuration uses PostgreSQL for the backend DB and Nginx for the frontend.

OS setup

Prepare a minimum installed CentOS8. https://qiita.com/SkyLaptor/items/9d597c3b5ae3db5dfc48

Database setup

This time, I chose PostgreSQL v12 as the database. On Zabbix compatibility list, it seems OK if PostgreSQL v9.2.24 or higher.

Installation

python


# wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
# rpm -Uvh epel-release-latest-8.noarch.rpm
# wget https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
# rpm -Uvh pgdg-redhat-repo-latest.noarch.rpm
# dnf install epel-release
# dnf module disable postgresql
# dnf config-manager --disable pgdg10 pgdg11 pgdg95 pgdg96
# dnf clean all

# dnf install postgresql12-server-12.4-1PGDG.rhel8.x86_64 postgresql12-odbc

Initial setting

python


# su - postgres
postgres$ vim .bash_profile

.bash_profile


export PGDATA
#Add the following
export PATH=$PATH:/usr/pgsql-12/bin

python


postgres$ source .bash_profile
postgres$ initdb --encoding=utf8 --locale=C -D /var/lib/pgsql/12/data
postgres$ exit

# systemctl start postgresql-12
# systemctl enable postgresql-12

Front end setup

If you set the front end to Nginx with Zabbix, it seems that it will be installed at the same time when Zabbix is set up.

Zabbix Server setup

Installation

python


# rpm -Uvh https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all
# dnf install zabbix-server-pgsql zabbix-web-pgsql zabbix-nginx-conf zabbix-agent zabbix-get vlgothic-fonts vlgothic-p-fonts

# sudo -u postgres createuser --pwprompt zabbix
could not change directory to "/root":No permission * Ignore it and OK
Enter password for new role:Any DB password
Enter it again:Any DB password again

# sudo -u postgres createdb -O zabbix zabbix
could not change directory to "/root":No permission * Ignore it and OK

# zcat /usr/share/doc/zabbix-server-pgsql*/create.sql.gz | sudo -u zabbix psql zabbix
...
INSERT 0 1
COMMIT

# cp -p /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.default
# vim /etc/zabbix/zabbix_server.conf

/etc/zabbix/zabbix_server.conf


# DBPassword=
DBPassword=DB password

python


# cp -p /etc/nginx/conf.d/zabbix.conf /etc/nginx/conf.d/zabbix.conf.default
# vim /etc/nginx/conf.d/zabbix.conf

shell:/etc/nginx/conf.d/zabbix.conf


listen          80;
server_name own server name;

python


# cp -p /etc/php-fpm.d/zabbix.conf /etc/php-fpm.d/zabbix.conf.default
# echo "php_value[date.timezone] = Asia/Tokyo" >> /etc/php-fpm.d/zabbix.conf

# rm /etc/alternatives/zabbix-web-font
# ln -s /usr/share/fonts/vlgothic/VL-PGothic-Regular.ttf /etc/alternatives/zabbix-web-font

# systemctl restart zabbix-server zabbix-agent nginx php-fpm
# systemctl enable zabbix-server zabbix-agent nginx php-fpm

Initial setup

Below in a web browser Access the URL of and start the initial setup.

http: // {server IP or FQDN} /

language

The system requirements check confirms that there is no NG.

language

Enter the DB password in the Password part. You don't have to touch the others.

language language language language

The initial ID is Admin and the password is zabbix.

language language

Set the display to Japanese. Click User settings at the bottom left of the screen.

language

Change Language toJapanese (ja_JP).

language

It is now displayed in Japanese.

language

Setting tuning

It will work as it is, but make various tunings so that it works comfortably.

PostgreSQL

python


# mkdir /etc/systemd/system/postgresql-12.service.d
# vim /etc/systemd/system/postgresql-12.service.d/override.conf

shell:/etc/systemd/system/postgresql-12.service.d/override.conf


[Service]
LimitNOFILE=65536
LimitNPROC=65536

python


# systemctl daemon-reload
# systemctl restart postgresql-12

Nginx

python


# vim /etc/systemd/system/nginx.service.d/override.conf

shell:/etc/systemd/system/postgresql-12.service.d/override.conf


[Service]
LimitNOFILE=65536
LimitNPROC=65536

python


# systemctl daemon-reload
# systemctl restart nginx

PHP

python


# vim /etc/php-fpm.d/zabbix.conf

shell:/etc/php-fpm.d/zabbix.conf


php_value[memory_limit] =1024MB * Adjustment required according to the environment

python


# systemctl restart zabbix-server zabbix-agent nginx php-fpm

Addition of monitoring target for Zabbix Agent

If the OS can install Zabbix Agent, it will be possible to acquire a wide variety of information. Let's put it in. Here, the minimum installation of CentOS 8 is targeted.

Agent installation on the monitored target

python


# wget https://repo.zabbix.com/zabbix/5.0/rhel/8/x86_64/zabbix-release-5.0-1.el8.noarch.rpm
# rpm -Uvh zabbix-release-5.0-1.el8.noarch.rpm
# dnf clean all
# dnf install zabbix-agent zabbix-get

# cp -p /etc/zabbix/zabbix_agentd.conf /etc/zabbix/zabbix_agentd.conf.default
# vim /etc/zabbix/zabbix_agentd.conf

/etc/zabbix/zabbix_agentd.conf


Server=127.0.0.1,IP address of Zabbix Server
#Hostname=Zabbix server * Comment out

python


# systemctl start zabbix-agent
# systemctl enable zabbix-agent

Register with Zabbix Server

Simply putting the Agent in the monitoring target will not register it in Zabbix Server. Follow the steps below to register.

Log in to the Zabbix Web Console and select Settings Host from the left menu.

language

Click Create Host at the top right of the host screen. language

Enter an arbitrary host name in host name, Linux Servers in group, and the target IP address in IP address of interface.

language

Apply Template OS Linux by Zabbix agent at Link new template and click `Add``.

language

After a few minutes of addition, check the agent status of the added host in the host list and the ZBX will turn green. It is now monitored.

language

Reference page

Recommended Posts

Zabbix 5 installation on CentOS 8
Docker installation on CentOS 6
OpenJDK installation on CentOS 7
OpenVPN on CentOS 8
First CentOS 8 installation
Maven on CentOS 7 tutorial
Use perltidy on CentOS 8
Install Golang on CentOS 8
Try OpenLiteSpeed on CentOS8
Install Neo4j 4.1.3 on centOS
OpenAM installation on VirtualBox
Install Vertica 10.0 on CentOS 6.10
Use mod_auth_cas on CentOS 8
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
Use bat on Centos.
Jetty v8 on CentOS7
Install Mattermost on CentOS 7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Build Zabbix on Ubuntu 20.04
Install PostgreSQL 13 on CentOS 7.5
Docker installation on WSL2
Installation of Oracle Database XE on CentOS7 (t2.micro instance)
Make exFat available on CentOS 7
Install zabbix agent (5.0) on Ubuntu 18.04
Install OpenFOAM v2006 on CentOS
Set up Gitolite on CentOS 7
Ruby installation on WSL2 + Ubuntu 20.04
Install Jenkins on Docker's CentOS
Install Apache on CentOS on VirtualBox
Introducing Let's Encrypt on CentOS 7
Java version change on CentOS
Install Ruby 2.7 on CentOS 7 (SCL)
Perform log rotation on centos
Try DPDK20 SDK on CentOS7 ①Install
How to deploy Laravel on CentOS 7
Enable Openjdk10 and maven on CentOS
Install Ruby 2.5 on CentOS 7 using SCL
Install Java Open JDK 8 on CentOS 7
Try putting CentOS 8 on Raspberry Pi 3
WordPress with Docker Compose on CentOS 8
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Steps to install MySQL 8 on CentOS 8
Use the iostat command on CentOS 8
Elmer / Ice installation (Ubuntu on WSL)
I tried installing CentOS 8 on ESXi 6.7
Steps to install devtoolset-6 on CentOS 7
Use Docker CE (official) on CentOS 8
Install Java 9 on windows 10 and CentOS 7
I installed F-Revo CRM 7.3 on CentOS 7.7
Try DPDK20 SDK on CentOS7 (2) Control DPDK driver
Install samba4 from source code on CentOS8
STS installation and Japanese localization on Windows 10
Set up ImpressPages 5.0 with LAMP on CentOS 7.3