LoginSignup
1
0

More than 3 years have passed since last update.

zabbix4.0+mariadb サーバ構築

Posted at

zabbix手順書

  • 概要
"とりあえず"zabbixサーバを作ってみるの巻
セキュリティ無視で作ってますが、実際に作るときはきちんとlocalで確認してから作ってください

OSの設定

  • 最新化
yum update
  • 今回はセキュリティ無視
systemctl stop firewalld
systemctl disable firewalld
  • selinuxをoff
vi /etc/selinux/config
==========
削除
SELINUX=enforcing
追加
SELINUX=disabled
==========
  • 反映
reboot

zabbixインストール

  • リポジトリ登録
rpm -i https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
  • パッケージインストール
yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent

DBインストール

yum install mariadb mariadb-server
  • mariadbの文字コードをUTF-8にする
vi /etc/my.cnf.d/server.cnf
==========
追加
[mariadb]
character-set-server = utf8
==========
  • mysqlの起動
systemctl start mariadb
systemctl enable mariadb

DB作成

  • DB作成
mysql -uroot -p
[Enter]
  • パスワードの設定
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'パスワード';
quit;
  • テーブル作成、初期データ投入
zcat /usr/share/doc/zabbix-server-mysql-4.0.24/create.sql.gz | mysql -uroot zabbix

※バージョンは異なる場合があるので、以下で確認してください
ll /usr/share/doc/ | grep zabbix-server-mysql

zabbixの設定

  • DBのパスワード変更
vi /etc/zabbix/zabbix_server.conf
==========
追加
DBPassword=パスワード
==========
  • zabbixのタイムゾーンの変更
vi /etc/httpd/conf.d/zabbix.conf
==========
追加(# php_value date.timezone Europe/Rigaの下)
php_value date.timezone Asia/Tokyo
==========

サービスを起動

  • 起動
systemctl start zabbix-server
systemctl start zabbix-agent
systemctl start httpd
  • 自動起動設定
systemctl enable zabbix-server
systemctl enable zabbix-agent
systemctl enable httpd

zabbixにアクセス

  • zabbixにアクセス
http://ZabbixサーバーのIPアドレス/zabbix/
  • Welcome to Zabbix 4.0 [Next step]

1.png

  • Check of pre-requisites [Next step]

2.png

  • Configure DB connection

Password パスワード [Next step]

3.png

  • Zabbix server details [Next step]

4.png

  • Pre-installation summary [Next step]

5.png

  • Install [Finish]

6.png

  • ログイン(デフォルト)
ID : Admin
pass : zabbix

7.png

  • ダッシュボード

8.png

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