LoginSignup
0
0

More than 1 year has passed since last update.

zabbix6.0(6.0.0alpha2)をubuntu20.04にインストール

Last updated at Posted at 2021-09-07

概要

ubuntu20.04にZabbixサーバをインストールしたときのメモ。
zabbix6.0のアルファ版が出たのでソースからインストールしてみました。
「とりあえず動くところまで」を目指したのでもしかしたら不要なパッケージ、不要な手順があるかも知れません。

参考

Zabbix Documentation 6.0
https://www.zabbix.com/documentation/6.0/manual/installation/install

手順

とりあえずアップデート

$ sudo apt update
$ sudo apt upgrade

ソースのダウンロード、展開

$ wget https://cdn.zabbix.com/zabbix/sources/development/6.0/zabbix-6.0.0alpha1.tar.gz
$ tar -zxvf zabbix-6.0.0alpha1.tar.gz

ユーザグループ、ユーザ追加

$ sudo addgroup --system --quiet zabbix
$ sudo adduser --quiet --system --disabled-login --ingroup zabbix --home /var/lib/zabbix --no-create-home zabbix
$ sudo mkdir -m u=rwx,g=rwx,o= -p /var/lib/zabbix
$ sudo chown zabbix:zabbix /var/lib/zabbix

もろもろインストール

$ sudo apt -y install mysql-server mysql-common pkg-config gawk make gcc clang
$ sudo apt -y install libmysqlclient-dev libxml2-dev libsnmp-dev snmp libopenipmi-dev libevent-dev libcurl4-openssl-dev libpcre3 libpcre3-dev
$ sudo apt -y install php7.4 php7.4-dev php-mbstring php-gd php-xml php-bcmath php-ldap php-mysql

ビルド通すために逐次入れていったのでもしかしたら不要なものがあるかも知れない

make install

$ cd zabbix-6.0.0alpha1
$ ./configure --enable-server --enable-agent --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2 --with-openipmi
$ make install

DBの作成

パスワードを「password」としています。

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

$ cd database/mysql
$ mysql -uzabbix -ppassword zabbix < schema.sql
# stop here if you are creating database for Zabbix proxy
shell> mysql -uzabbix -ppassword zabbix < images.sql
shell> mysql -uzabbix -ppassword zabbix < data.sql 

zabbix_server.confの編集

$ sudo vi /usr/local/etc/zabbix_server.conf

DBPasswordを編集

# DBPassword=
↓
DBPassword=passoword

passwordはDB作成時のパスワード

zabbix_server/ zabbix_agentdの起動

$ sudo zabbix_server
$ sudo zabbix_agentd

WebUIのインストール

$ mkdir /var/www/html/zabbix
$ cp -a . /var/www/html/zabbix

confディレクトリに書き込み権限付与

$ sudo chmod o+w /var/www/html/zabbix/conf

WebUIにアクセス

http://<ipadrress>/zabbix/ にアクセス
zabbixUI1.jpg

この先でエラーになるので 先にphp.ini を編集しておく

$ sudo vi /etc/php/7.4/apache2/php.ini

下記箇所を編集しておく
post_max_size 16M
max_execution_time 300
max_input_time 300

apache再起動

$ sudo systemctl restart apache2

zabbixUI2.jpg

次のステップへ

zabbixUI3.jpg
パスワードはDB作成時のパスワードを入力

zabbixUI4.jpg

もし最後にこんなの出たら、「設定ファイルをダウンロード」して
/var/www/html/zabbix/conf
に zabbix.conf.php を作成しする(内容コピペ)

再度WebUIにアクセス

http://<ipadrress>/zabbix/ にアクセス

zabbixUI5.jpg

Admin / zabbix でログインできる
zabbixUI6.jpg

0
0
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
0