Ubuntu 20.04
Sponsored Link

Zabbix 5.0 : インストール2020/06/24

 
統合監視システム Zabbix をインストールして設定します。
監視対象には Linux のみならず、Windows や Solaris、IBM の AIX なども一括で監視することができます。
[1]
[2]
[3]
[4] Zabbix 5.0 リポジトリを設定して、Zabbix サーバーをインストールします。
Zabbix サーバー自身も監視できるよう、監視対象ホストに必要な Zabbix Agent も同時にインストールしておきます。
root@dlp:~#
wget https://repo.zabbix.com/zabbix/5.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_5.0-1+focal_all.deb

root@dlp:~#
dpkg -i zabbix-release_5.0-1+focal_all.deb

Selecting previously unselected package zabbix-release.
(Reading database ... 72691 files and directories currently installed.)
Preparing to unpack zabbix-release_5.0-1+focal_all.deb ...
Unpacking zabbix-release (1:5.0-1+focal) ...
Setting up zabbix-release (1:5.0-1+focal) ...

root@dlp:~#
apt update

root@dlp:~#
apt -y install zabbix-server-mysql zabbix-apache-conf zabbix-agent zabbix-frontend-php php-mysql php-gd php-bcmath php-net-socket php-pear

[5] データベースの設定をしておきます。
root@dlp:~#
mysql

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 55
Server version: 10.3.22-MariaDB-1ubuntu1 Ubuntu 20.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# charset は utf8 で作成
# utf8mb4 では create.sql でインデックスの最大長 3072 バイトを超えてエラーとなる
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; 
Query OK, 1 row affected (0.00 sec)

# [password] は任意のパスワードに置き換え
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@'localhost' identified by 'password'; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges; 
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit
Bye

root@dlp:~#
cd /usr/share/doc/zabbix-server-mysql

root@dlp:/usr/share/doc/zabbix-server-mysql#
gzip -d create.sql.gz

root@dlp:/usr/share/doc/zabbix-server-mysql#
mysql zabbix < create.sql

[6] Zabbix サーバーを設定して起動します。
root@dlp:~#
vi /etc/zabbix/zabbix_server.conf
# 100行目:DB 名確認

DBName=zabbix
# 116行目:DB ユーザー名確認

DBUser=zabbix
# 125行目:DB ユーザーのパスワードを追記

DBPassword=password
root@dlp:~#
systemctl restart zabbix-server
[7] Zabbix サーバー自身も監視できるよう Zabbix Agent を設定して起動します。
root@dlp:~#
vi /etc/zabbix/zabbix_agentd.conf
# 171行目:自身のホスト名に変更

Hostname=
dlp.srv.world
root@dlp:~#
systemctl restart zabbix-agent
[8] 必要であれば Apache2 のアクセス許可の部分設定を変更しておきます。以上で Zabbix サーバーの基本設定は完了です。
root@dlp:~#
vi /etc/apache2/conf-enabled/zabbix.conf
# 10行目:必要であれば Web 管理画面へのアクセスを制限 (デフォルトは制限なし)

#
Allow from all
Allow from 10.0.0.0/24
# 30行目:コメント解除して自身にタイムゾーンに変更

php_value date.timezone
Asia/Tokyo
root@dlp:~#
systemctl restart apache2
関連コンテンツ