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]
- Check of pre-requisites [Next step]
- Configure DB connection
Password パスワード [Next step]
- Zabbix server details [Next step]
- Pre-installation summary [Next step]
- Install [Finish]
- ログイン(デフォルト)
ID : Admin
pass : zabbix
- ダッシュボード