概要
ObserviumをCentos6.7にインストール
構成
Software | Version |
---|---|
CentOS | 6.7 |
Apache | 2.2 |
PHP | 7.1 |
MySQL | 5.1.73 |
Observium CE | 18.9.9420 |
参考手順
手順
- リポジトリを追加
# yum install -y epel-release
# rpm -ivh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
- Apache、fping、MySQL、SNMPをインストール
# yum install -y httpd mysql-server fping net-snmp net-snmp-utils
- PHP7.1をインストール
# yum install -y --enablerepo=remi,remi-php71 php php-mysql php-pear
- MySQLを起動
# service mysqld start
# chkconfig mysqld on
- Observium用データベースを作成
# mysql -uroot
mysql> CREATE DATABASE observium;
mysql> GRANT ALL PRIVILEGES ON observium.* TO 'observium'@'localhost' IDENTIFIED BY 'observium';
mysql> exit
- /optに移動
# cd /opt
- Observiumパッケージをダウンロード
# wget http://www.observium.org/observium-community-latest.tar.gz
# tar zxvf observium-community-latest.tar.gz
- /opt/observiumに移動
# cd /opt/observium
- config.phpをコピー
# cp config.php.default config.php
- config.phpを編集
# vi config.php
config.php
$config['db_user'] = 'observium'; # CHANGE
$config['db_pass'] = 'observium'; # CHANGE
$config['fping'] = "/usr/sbin/fping"; # ADD
$config['login_remember_me'] = FALSE; # ADD
- 初期データをデータベースに挿入
# ./discovery.php -u
- RRD用のディレクトリを作成
# mkdir /opt/observium/rrd
# chown apache:apache /opt/observium/rrd
- Apacheのログ用のディレクトリを作成
# mkdir /opt/observium/logs
# chown apache:apache /opt/observium/logs
- httpd.confを編集
# vi /etc/httpd/conf/httpd.conf
/etc/httpd/conf/httpd.conf
#ServerName www.example.com:80
ServerName localhost:80 # ADD
### ADD ###
<VirtualHost *:80>
DocumentRoot /opt/observium/html/
ServerName observium.domain.com
CustomLog /opt/observium/logs/access_log combined
ErrorLog /opt/observium/logs/error_log
<Directory "/opt/observium/html/">
AllowOverride All
Options FollowSymLinks MultiViews
</Directory>
</VirtualHost>
### ADD ###
- Apacheを起動
# service httpd start
# chkconfig httpd on
- Observiumの初期ユーザを追加
# ./adduser.php observium observium 10
- 監視対象デバイスを追加
# ./add_device.php centos60 public v2c
- 追加した監視対象デバイスを読み込み
# ./discovery.php -h all
- 監視対象デバイスから情報を取得
# ./poller.php -h all
- cron設定
# vi /etc/cron.d/observium
/etc/cron.d/observium
33 */6 * * * root /opt/observium/discovery.php -h all >> /dev/null 2>&1
*/5 * * * * root /opt/observium/discovery.php -h new >> /dev/null 2>&1
*/5 * * * * root /opt/observium/poller-wrapper.py 1 >> /dev/null 2>&1
- cronをリロード
# service crond reload
- Observiumにアクセス
- http://localhost/
- Username
observium
- Password
observium