Cacti
Important
- ssh 経由の取得と snmp 経由の取得があるのでサーバからきちんと接続できるかを確認すること
Install
server
RRDTools インストール
# yum isntall rrdtool
Cactiインストール
# yum install cacti
cacti ユーザ用の鍵作成
# ssh-keygen -N "" -t rsa
MySQLの設定
データベース作成
mysql> create database cacti;
ユーザ作成
mysql> grant all privileges on cacti.* to cactiuser@localhost identified by 'cactiuser';
Cacti 用 SQL 流し込み
# mysql -u cactiuser -p cacti < mysql -u cactiuser -p cacti < /usr/share/doc/cacti-0.8.8a/cacti.sql
Cacti の mysql 用パスワード設定
# vim /var/www/cacti/include/config.php
Polloer の設定
*/5 * * * * /usr/bin/php /var/www/cacti/poller.php > /dev/null 2>&1
Apacheの設定
# cat /etc/httpd/conf.d/cacti.conf Alias /cacti/ /var/www/cacti/ <Directory /var/www/cacti/> DirectoryIndex index.php Options -Indexes AllowOverride all AddType application/x-httpd-php .php php_flag magic_quotes_gpc on php_flag track_vars on </Directory>
UI 設定
- http://xx.xx.xx.xx/cacti/
- 設定にそってインストール
- 初期のログイン IP / パスワードは、admin/admin
spine導入
必要なパッケージの導入
# yum install net-snmp-devel mysql-devel openssl-devel
cacti-spine インストール
# cd /usr/local/src/ # wget http://www.cacti.net/downloads/spine/cacti-spine-0.8.8b.tar.gz # tar zxvf cacti-spine-0.8.8b.tar.gz # cd cacti-spine-0.8.8b # ./configure # make # make install
設定
- DB の設定を記載する
/usr/local/spine/etc/spine.conf
- DB の設定を記載する
cacti画面の変更
- Configuration(Settings) --> Path --> Spine Poller File Path
- /usr/local/spine/bin/spine
- [OK: FILE FOUND] を確認
- Configuration(Settings) --> Poller - Poller Type
- spine
- Configuration(Settings) --> Path --> Spine Poller File Path
client
net-snmpインストール
# yum install net-snmp
snmp 設定ファイル変更
v2 の場合
# snmp v2c config com2sec manager-01 192.168.10.20 manager-01 group snmpGroup v1 manager-01 group snmpGroup v2c manager-01 view all included .1 80 access snmpGroup "" any noauth exact all none none syslocation Tokyo syscontact test@example.com disk /boot disk /
v3 の場合
# snmp v3 configrouser snmp_reader priv .1 createUser snmp_reader SHA hoge DES hoge syslocation Tokyo syscontact test@example.com disk / disk /boot
ログ出力させない
# echo 'OPTIONS="-p /var/run/snmpd.pid"' >> /etc/sysconfig/snmpd
cactiユーザの作成
# useradd cacti # passwd cacti # cd /home/cacti # mkdir .ssh # chmod 700 .ssh # chown cacti:cacti .ssh # cd .ssh ※cactiサーバより公開鍵をもってくる # vim authorized_keys # chmod 600 authorized_keys # chown cacti.cacti authorized_keys
Tips
- Expected some arguments after 'COMMENT:'
- バグなのでパッチをあてがう
上記URLからパッチダウンロード
# cd /path/to/cacti/lib/ # patch -p1 -N < cacti088b_empty_comment.patch
- バグなのでパッチをあてがう