・zabbixのyumリポジトリの登録

#cd /usr/local/src
#rpm -ivh http://repo.zabbix.com/zabbix/2.0/rhel/6/x86_64/zabbix-release-2.0-1.el6.noarch.rpm


・インストール(2013/10/03時点のバージョンは2.0.8-2)

#yum -y install zabbix-server-mysql zabbix-web-mysql
#yum -y install zabbix-agent
#yum -y install zabbix-get

zabbix-get は設定する時にあるとなにかと便利です。
(使い方サンプル)zabbix_get -s 127.0.0.1 -p 10050 -k agent.ping

・zabbixのyumリポジトリの無効化

#vim /etc/yum.repos.d/zabbix.repo
---(下記を変更)---------------------------
[zabbix]
name=Zabbix Official Repository - $basearch
baseurl=http://repo.zabbix.com/zabbix/2.0/rhel/6/$basearch/
enabled=1
 ↓
enabled=0

[zabbix-non-supported]
name=Zabbix Official Repository non-supported - $basearch
baseurl=http://repo.zabbix.com/non-supported/rhel/6/$basearch/
enabled=1
 ↓
enabled=0
------------------------------

・MySQLにZabbix用のDBとユーザを作成

#mysql -u root -p

> SET PASSWORD FOR root@localhost=PASSWORD('dbrootpass');   (既に存在していれば不要)

---(下記を実行)---------------------------
・Zabbix用DBの作成
> create database <DB Name> character set utf8;

・Zabbix用ユーザの作成
> grant all privileges on <DB Name>.* to <USER Name>@localhost identified by '<Password>';

・設定の反映
FLUSH PRIVILEGES;
exit
------------------------------

・Zabbix用のDBスキーマとデータをインポート

#mysql -u root -p ozzabbix < /usr/share/doc/zabbix-server-mysql-2.0.8/create/schema.sql
#mysql -u root -p ozzabbix < /usr/share/doc/zabbix-server-mysql-2.0.8/create/images.sql
#mysql -u root -p ozzabbix < /usr/share/doc/zabbix-server-mysql-2.0.8/create/data.sql

・zabbixサーバの設定

#vi /etc/zabbix/zabbix_server.conf
---(下記を変更)----------------
DBName=<DB Name>
DBUser=<USER Name>
DBPassword=<DB Password>
------------------------------

vim /etc/zabbix/web/zabbix.conf.php
---(下記を変更)----------------
$DB['DATABASE'] = '<DB Name>';
$DB['USER']     = '<USER Name>';
$DB['PASSWORD'] = '<DB Password>';
------------------------------


Zabbix server is not running: the information displayed may not be current.

このようなメッセージが表示される場合は、zabbix_server.confzabbix.conf.phpの設定を見直してみてください。

・Zabbixサーバの起動

#service zabbix-server start

・Zabbixサーバの自動起動を設定

#chkconfig zabbix-server on

・Apacheの再起動

#service httpd restart

・ブラウザアクセスして初期設定を開始します。
 (ホスト名はご自分の環境に読替えてください)
  http://ドメイン名/zabbix/

——————————
1. Welcome
 「NEXT」
zabbix

2. Check of pre-requisites
 すべて「OK」であれば「NEXT」
nagios
3. Configure DB connection
 ———
 Type:MySQL
 Host:localhost
 Port:0
 Name:<DB Name>
 User:<USER Name>
 Password:<Password>
 ———
 上記を設定して「Next」
nagios
4. Zabbix server details
 そのまま「NEXT」
zabbix
5. Pre-Installation Summary
 そのまま「NEXT」
zabbix
6. Install
 「Finish」
zabbix
——————————
以上が終了するとzabbixのログイン画面が表示されます。

・初期ユーザでログインします。
 ユーザ名: admin 
 パスワード:zabbix

・パスワードと言語の変更
Administration>Users Members列の「Admin」をクリック、下記入力して「Save」を押します。
——————————
Password:「Change password」をクリックしてパスワードを入力
Language:Japanese(ja_JP)
——————————
ブラウザをリロードすると日本語表示になります。

・日本語フォント化(文字化け対策)

yum -y install ipa-gothic-fonts		(既に入っていれば不要です)
mv /usr/share/zabbix/fonts/graphfont.ttf /usr/share/zabbix/fonts/graphfont.ttf_backup
ln -s /usr/share/fonts/ipa-gothic/ipag.ttf /usr/share/zabbix/fonts/graphfont.ttf

<PR>


ZABBIXサーバ構築(version 2.0) CentOS
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *