2010年9月30日木曜日

Opsviewのインストールメモ

Zabbixと比較してあーだこーだ言うためにも、触ってみるかってことでインストールしてみました。
ま、RPMでならインストールは簡単ですな。

以下、詳細です。

1.OSのインストール
2.ユーザとグループの作成
 nagiosユーザを作成し、nagiosグループとnagcmdグループに所属させる。
 # useradd nagios
 # groupadd nagcmd
 # usermod -G nagcmd nagios
3.必要パッケージのインストール
 mysql-server
 java-1.6.0-openjdk
4.MySQL設定の追加
 /etc/my.cnfに以下の設定を追加する。下の2行は推奨ではあるが特に
 最後のinnodb_buffer_pool_sizeは、稼動させるサーバ上の実メモリ
 サイズを考慮して指定すること。
---
default-character-set=utf8
skip-character-set-client-handshake
innodb_file_per_table
# innodb_flush_log_at_trx_commit=2
# innodb_buffer_pool_size=1G
---
5.rpmforgeリポジトリの追加
6.Opsviewリポジトリの追加
--- /etc/yum.repos.d/opsview.repo
[opsview]
name = Opsview
baseurl = http://downloads.opsera.com/opsview/yum/community/centos/5/$basearch
enabled = 1
protect = 0
gpgcheck = 0
---
7.Opsviewのインストール
 # yum install opsview
8.MySQLサーバの起動
 # service mysqld start
 # chkconfig mysqld on
9.nagiosアカウントの環境用設定を追加
 ~nagios/.bash_profileに以下を追加。
 ---
 test -f /usr/local/nagios/bin/profile && . /usr/local/nagios/bin/profile
 ---
10.nagiosユーザに切り替え
 # su - nagios
11.DBアカウントのパスワード変更
 /usr/local/nagios/etc/opsview.conf 内の「changeme」となっている
 パスワードを変更する。
12.
 $ /usr/local/nagios/bin/db_mysql -u root -p password
 $ /usr/local/nagios/bin/db_opsview db_install
 $ /usr/local/nagios/bin/db_runtime db_install
 $ /usr/local/nagios/bin/db_odw db_install
 $ /usr/local/nagios/bin/db_reports db_install
 $ /usr/local/nagios/bin/rc.opsview gen_config

 $ /etc/init.d/opsview-web start

http://IPアドレス:3000/

13.Apache経由でアクセス可能に設定
 # cd /etc/httpd/conf.d
 # cp /usr/local/nagios/installer/apache_proxy.conf opsview.conf
 # vi opsview.conf

 DocumentRootをコメントアウト
 # vi /etc/httpd/conf/httpd.conf

 # usermod -G nagcmd apache

username: admin
password: initial

14.ConfigurationのReload
 画面上部の「Configuration status」が黄色の場合は、設定が反映
 されていないので、クリックして「Reload Configuration」ボタン
 をクリックして反映する。

おまけ:
 メッセージの日本語化は、RPMでインストールした場合は、
  /usr/local/opsview-web/lib/Opsview/Web/I18N/
 ディレクトリに各言語用のファイルが配置される。
 日本語版の言語ファイルは無いので、i_default.poをコピーして
 ja.poを作成し、各メッセージを翻訳する。文字コードはUTF-8。
 変更したら、
  /etc/init.d/opsview-web restart
 を実行すること。


マルチランゲージ対応と聞いていたから期待していたのに、内部はNagiosそのままだから、Nagiosは別途日本語化しないと駄目。
ま、これは「マルチランゲージ対応とは言えない」が私の結論。

でもまぁ、素のNagios使うよりはよさそう。ichingaとも比較してみないとね。

2010年9月27日月曜日

Zabbix Install for English speaker(from source)

This domeument for install zebbix with MySQL on CentOS 5.
But, this document is supprt in Japanese only.

文法がとかいう私の英語力に対するつっこみは受け付けません。

At first, Please read offical manuals.
http://www.zabbix.com/documentation/1.8/manual/installation

---
1. Install OS
---

First, CentOS 5 or RHEL 5 install to box with develop environment.

---
2. Install depends libraries
---

Install from install DVD or official repositry.
mysql-devel, net-snmp-devel, curl-devel

Download and Install from rpmforge.
iksemel-devel
http://packages.sw.be/iksemel/

---
3. Download Zabbix tarball
---

Download from offical site.
http://www.zabbix.com/download.php

File name is 'zabbix-1.8.3.tar.gz'.

---
4. Expand that tarball
---

# tar zxvf zabbix-1.8.3.tar.gz

---
5. Create database
---

# cd zabbix-1.8.3
# service mysqld start
# mysql -uroot
mysql> create database zabbix character set utf8;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by 'password';
mysql> flush privileges;
mysql> quit
# mysql -uzabbix -ppassword zabbix < create/schema/mysql.sql
# mysql -uzabbix -ppassword zabbix < create/data/data.sql
# mysql -uzabbix -ppassword zabbix < create/data/images_mysql.sql


---
6. Configure sources & make install
---

# ./configure --enable-server --enable-agent --with-mysql --with-net-snmp --with-jabber --with-libcurl
# make
# make install

---
7. Create config files
---

# cd /etc
# mkdir zabbix

zabbix_server.conf and zabbix_agentd.conf copy to /etc/zabbix.

# cd zabbix-1.8.3
# cp misc/conf/zabbix_agentd.conf misc/conf/zabbix_server.conf /etc/zabbix

Edit config files.
zabbix_server.conf:
'DBUser' and 'DBPassword' must change to your database for zabbix in zabbix_server.conf.
zabbix_agentd.conf:
'Server' must change to zabbix server's IP Address.
'Hostname' must change to hostname that zabbix_agentd running.
This hostname use on host infomation of Web frontend.

---
8. Create start/stop script for init
---

Sample file are under misc/init.d/redhat/8.0.
Copy to /etc/init.d and edit if you want.
progdir="/usr/local/zabbix/bin/" to progdir="/usr/local/sbin/"

# chmod +x /etc/init.d/zabbix*

---
9. Start Server and Agent
---

# useradd -s /sbin/nologin zabbix
# service zabbix_server start
# service zabbix_agentd start


---
10. Web frontend setting
---
Install from install DVD or official repositry.
httpd, php, php-bcmath, php-gd, php-mbstring, php-xml, php-mysql

# cd zabbix-1.8.3/frontends
# cp -r php /var/www/html/zabbix
# cd /var/www/html/zabbix
# chown -R apache:apache conf
# chmod 775 conf

some php setting change in /etc/php.ini.
ex.
memory_limit = 128M
post_max_size = 16M
upload_max_filesize = 2M
max_execution_time = 300
max_input_time = 300
mbstring.func_overload = 6
date.timezone = Asia/Tokyo

# service httpd start

Access to http://ip-addr/zabbix/