Zabbix 6.4 Installation
Server
Published: 2023-05-02

This is a note on setting up Zabbix 6.4. The configuration includes Zabbix + Nginx + php-fpm + PostgreSQL + TimescaleDB.

EnvironmentVersion
Ubuntu22.04
Zabbix6.4
PostgreSQL15
Nginx1.18.0
php-fpm8.1.2

Register the Repository

Download and install Zabbix

# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update

Install Zabbix

# apt install zabbix-server-pgsql zabbix-frontend-php php8.1-pgsql zabbix-nginx-conf zabbix-sql-scripts zabbix-agent

Install PostgreSQL

# apt install postgresql postgresql-contrib

Add PostgreSQL Repository and Install

# apt install software-properties-common gnupg postgresql-common apt-transport-https lsb-release wget
# /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh
# echo "deb https://packagecloud.io/timescale/timescaledb/ubuntu/ $(lsb_release -c -s) main" | sudo tee /etc/apt/sources.list.d/timescaledb.list
# wget --quiet -O - https://packagecloud.io/timescale/timescaledb/gpgkey | sudo apt-key add -
# apt update
# apt install timescaledb-2-postgresql-15
  • Enable localhost Listen
# sed -i "/#listen_addresses/a listen_addresses = 'localhost'" /etc/postgresql/15/main/postgresql.conf
  • Enable TimescaleDB
# sed -i "/#shared_preload/a shared_preload_libraries = 'timescaledb'" /etc/postgresql/15/main/postgresql.conf
  • Apply Changes
# systemctl restart postgresql

Setup Database

  • Set Password and Create DB
# sudo -u postgres createuser --pwprompt zabbix
# sudo -u postgres createdb -O zabbix zabbix
  • Load Tables and Schema
# zcat /usr/share/zabbix-sql-scripts/postgresql/server.sql.gz | sudo -u zabbix psql zabbix
  • Enable TimescaleDB
# echo "CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;" | sudo -u postgres psql zabbix
  • Load Initial Schema for TimescaleDB
# cat /usr/share/zabbix-sql-scripts/postgresql/timescaledb.sql | sudo -u zabbix psql zabbix

Configure Nginx

  • Remove default Nginx configuration
# rm -v /etc/nginx/sites-enabled/default

To avoid the “Welcome to nginx” page, remove the default configuration.

  • Edit /etc/zabbix/nginx.conf

There is a configuration file for Zabbix in /etc/nginx/conf.d, linked from /etc/zabbix/nginx.conf. Edit it as needed.

  • Apply Nginx Configuration
# systemctl reload nginx

Setup UI

  • Access via web browser.
http://<server IP address>/

Welcome

  • Set “Default language” to Japanese (ja_JP).

If ja_JP.UTF-8 is not included in Ubuntu locales, it cannot be selected.

  • Install ja_JP.UTF-8
# apt install language-pack-ja
  • Restart php-fpm
# systemctl restart php8.1-fpm

Now you can select Japanese (ja_JP).

Prerequisites Check

  • Ensure everything is OK.

Database Connection Setup

  • Set the database password.

Verify Configuration Parameters

  • Set an appropriate Zabbix server name.
  • Set the “Default time zone” to (UTC+09:00) Asia/Tokyo.

Login

Login Information-
UsernameAdmin
Passwordzabbix

Change the password after logging in.

Start zabbix-server

# systemctl start zabbix-server

Fix Garbled Graph Text

Install Japanese fonts to fix garbled text in graphs.

  • Install Japanese Fonts
# apt install fonts-ipafont-gothic
  • Register the font for use by Zabbix
# update-alternatives --install /usr/share/zabbix/assets/fonts/graphfont.ttf zabbix-frontend-font /usr/share/fonts/opentype/ipafont-gothic/ipagp.ttf 20
  • Verify that ipafont-gothic is selected.
# update-alternatives --config zabbix-frontend-font

This will resolve the garbled text issue in graphs.