LoginSignup
0
5

More than 1 year has passed since last update.

Zabbix6.0 LTSをubuntu20.04にインストールしてみた

Posted at

Zabbix6.0LTSがついにリリースされましたのでubuntu20.04にインストールしてみました。
忘備録も兼ねて手順を記載します。

※あくまでも自分のテスト環境にインストールした手順ですので、各自の環境に合わせて適宜読み替えお願いします。

1. Zabbix6.0のインストール環境

  • OS : Ubuntu 20.04.3 LTS apt upgradeだけ実施した初期インストール状態
  • DB : MySQL
  • Web : Apache

非常に一般的な環境でインストールを実施します。

2. インストール手順

2-1. MySQLのインストール、初期設定

MySQLのインストール

$ sudo apt install mysql-server

MySQLの初期設定

おまじないの初期設定です。

$ sudo mysql_secure_installation

Securing the MySQL server deployment.
Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. Would you like to setup VALIDATE PASSWORD component?
Press y|Y for Yes, any other key for No: n

New password: //任意のパスワード
Re-enter new password://任意のパスワード

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : y

Remove test database and access to it? (Press y|Y for Yes, any other key for No) : y
- Dropping test database...
Success.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : y

All done!

2-2. Zabbixのインストール

リポジトリインストール

$ sudo wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-1+ubuntu20.04_all.deb
$ sudo dpkg -i zabbix-release_6.0-1+ubuntu20.04_all.deb
$ sudo apt update

Zabbix関連パッケージのインストール

$ sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent

2-3. Zabbixの初期設定

MySQLの初期設定

$ mysql -uroot -p
Enter password:  //先程設定したパスワード

mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
Query OK, 1 row affected (0.01 sec)

mysql> create user zabbix@localhost identified by 'password';
Query OK, 0 rows affected (0.02 sec)

mysql> grant all privileges on zabbix.* to zabbix@localhost;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;

イニシャルスキーマのインポート

$ sudo zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix
Enter password: password

zabbix_server.confへDB情報の設定を追加

$ sudo vi /etc/zabbix/zabbix_server.conf

で以下の設定を変更

#DBPassword=password   //コメントアウトを外し
DBPassword=//最初に設定したDBのパスワードに変更

2-4. ZabbixServerの起動

$ sudo systemctl restart zabbix-server zabbix-agent apache2
$ sudo systemctl enable zabbix-server zabbix-agent apache2
$ sudo systemctl status zabbix-server zabbix-agent apache2
でサービスが全て起動していることを確認

ここまででCUIを使った初期設定は終了です。

2-5.GUIでの初期設定

http://[IP address  or  FQDN]/zabbix

にWebブラウザからアクセスして初期設定を行います。

言語選択

zabbix6-01.jpg

希望の言語があれば選択してNext

プリチェック

zabbix6-02.jpg

プリチェックで全てOKなことを確認

DBへの接続情報設定

zabbix6-03.jpg

DBへの接続情報設定です。
基本的にはPasswordだけ入れればのはず。

基本設定

zabbix6-04.jpg

Server name、標準時刻、テーマカラーを設定します。

最終確認

zabbix6-05.jpg

Darkを選んだので背景が黒くなりました。
最終確認し問題なければNext

インストール完了

zabbix6-06.jpg

3. ログインテスト

http://[IP address  or  FQDN]/zabbix

に再びアクセスしログインしてみましょう。
zabbix6-07.jpg

  • 初期Username : Admin
  • 初期Password : zabbix

となっています。

4. インストール完了

zabbix6-08.jpg

素敵なトップページが開けばインストール完了です。

後は粛々とホストの追加、アイテムの追加を行って楽しい監視ライフを!

最後に

手順は公式Webサイトでも解説されています。
本記事も公式Webサイトの手順を参考にしています。

0
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
5