0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Zabbix Server 6.2をAzure VMにインストールする(Ubuntu20.04)

Last updated at Posted at 2022-08-30

この記事の目的

検証用Zabbixサーバーを建てる
Kubernetesが監視できるようになったと聞いて、テストしてみたかった

AzureVMの構成

適当につくる

項目 設定値
VM Image Ubuntu 20.04
VM Size Standard B2s
Disk Standard SSD
NIC グローバルIPをつける
SSHとHTTPを自分のグローバルIPのみNSGで許可する

Zabbixのインストール

# とりあえずアップデート
apt update -y && apt upgrade -y

# MySQLのインストール
apt install -y mysql-server

# 日本語の追加
dpkg-reconfigure locales
-> ja-jpのUTF8を追加する

# apache2の停止
systemctl stop apache2
systemctl disable apache2

あとはzabbixの公式手順どおり

wget https://repo.zabbix.com/zabbix/6.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.2-1%2Bubuntu20.04_all.deb
dpkg -i zabbix-release_6.2-1+ubuntu20.04_all.deb
apt update
apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent

mysql -uroot -p
※passwordはpassword
mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;

zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p zabbix

mysql -uroot -p
※passwordはpassword
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;

/etc/zabbix/zabbix_server.confを編集する

vi /etc/zabbix/zabbix_server.conf
---
+ DBPassword=password
---

Nginxの設定

適当にNginxの設定をします

vi /etc/nginx/nginx.conf
---
 ##
 # Virtual Host Configs
 ##

+ include /etc/zabbix/nginx.conf
---
vi /etc/zabbix/nginx.conf
listen 8080; -> listen 80;
server_nameのコメントアウトを外す

サービスの起動

systemctl restart zabbix-server zabbix-agent nginx php7.4-fpm
systemctl enable zabbix-server zabbix-agent nginx php7.4-fpm

VMのグローバルIPに接続すれば接続できるはず。

http:///

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?