1
2

More than 3 years have passed since last update.

爆速でZabbixサーバを構築する(CentOS 7)

Posted at

今日の目標 

Zabbixサーバを構築する手順を整理する

環境

CentOS7
Zabbix 4.0

SElinux 無効化

vi /etc/selinux/config

SElinux=disabled

設定を反映させるため、再起動します。

# reboot

Zabbixのインストール

# yum update

今回はZabbix4.0 のRPMリポジトリをインストールします。

# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
# yum clean all

こちらのツールも同時にインストール

# yum -y install yum-utils
# yum-config-manager --enable rhel-7-server-optional-rpms
# yum -y install zabbix-server-mysql zabbix-proxy-mysql zabbix-web-mysql zabbix-agent

DBをインストール

# yum install mariadb mariadb-server 

Maria DB を自動起動設定にします。

# systemctl enable mariadb.service
# systemctl start mariadb.service

DBの初期設定をします。

# mysql_secure_installation

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:なんか適当に
Re-enter new password:なんか適当に
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
mysql -uroot -p
Enter password:

MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;

Query OK, 1 row affected (0.01 sec)

grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; --なんか適当にパスワード

MariaDB [(none)]> quit;
Bye

初期データとスキーマをインポート

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password: # 上記のパスワード

Zabbixサーバのデータベース設定をする

vi /etc/zabbix/zabbix_server.conf
DBPassword= #上記のパスワードを入力

Zabbixフロントエンドのタイムゾーンを設定

# vi /etc/httpd/conf.d/zabbix.conf
↓をよしなに変更
php_value date.timezone Asia/Tokyo

Zabbixサーバ再起動

systemctl restart zabbix-server httpd zabbix-agent
systemctl enable zabbix-server httpd zabbix-agent

Zabbixにアクセス

http://YOUR_IP/zabbix/
image.png

image.png

DBパスワードを入力(設定したパスワード)

image.png

デフォルトはホスト名 「localhost」だが「zabbix」に変更

image.png

設定内容を確認

image.png

無事インストールが出来たことを確認

image.png

デフォルトでUsername Admin Password zabbix

image.png

やった!
image.png

参考文献

電算星組

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