Zabbixサーバ構築

CentOS 6.6で行った。

Zabbixサーバ構築

#リポジトリの登録
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm

# Zabbixサーバのインストール
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese

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

# MySQLの環境設定
vim /etc/my.cnf で以下の2行つけたす
default-character-set=utf8
skip-character-set-client-handshak

# MySQL起動
service mysqld start

# Zabbix用データベースの作成
mysql -uroot
create database database_name;
grant all privileges on database_name.* to username@localhost identified by 'password';
flush privileges;
exit

# 初期データベースのインポート
cd /usr/share/doc/zabbix-server-mysql-2.2.11/create
mysql -uroot database_name < schema.sql
mysql -uroot database_name < images.sql
mysql -uroot database_name < data.sql

# Zabbixサーバの環境設定
vim /etc/zabbix/zabbix_server.conf で
DBPassword= をコメントアウトして適当な値を入れる

# Zabbixサーバの起動 
service zabbix-server start

# PHPの環境設定
vim /etc/httpd/conf.d/zabbix.conf で
タイムゾーンをAsia/Tokyoにする

# Apacheの起動
service httpd start

# 自動起動の設定
chkconfig mysqld on
chkconfig zabbix-server on
chkconfig httpd on

Zabbixエージェント

# Zabbixエージェントのインストール
yum install -y zabbix-agent

# Zabbixエージェントの設定
vim /etc/zabbix/zabbix_agentd.conf で
Server=server IP Address
ServerActive=Server IP address

# 自動起動の設定と起動
chkconfig zabbix-agent on
service zabbix-agent start