conf t

インフラエンジニアのメモ

cactiのインストール

f:id:monaski:20160919114119j:plain

cactiをインストールする。
mysqlも入ってなかったので一緒にインストール

yum install cacti
yum install mysql-server

service mysqld start

mysqlを設定する
rootユーザを設定したのちrootでログインし、
データベースcactiを作成している。

# /usr/bin/mysqladmin -u root password 'password'
# mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.1.73 Source distribution

Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database cacti
    -> ;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on cacti.* to cactiuser@localhost identified by 'cactiuser';
Query OK, 0 rows affected (0.00 sec)

mysql> exit

用意されている初期データの流し込み。初期データ流し込み用sql場所はバージョンによって変わるらしいが、
今回はcronで指定されるpoller.phpと同じ場所にあった。

# mysql -u cactiuser -p cacti < /var/www/cacti/cacti.sql
Enter password:

cactiのクーロンを確認。
この/var/www/cacti配下に他の設定ファイルもあった。
今回コメントアウトされていなかったが、されていた場合はコメントアウトを外す。

# cat /etc/cron.d/cacti
*/5 * * * *     cacti   php /var/www/cacti/poller.php &>/dev/null

apacheのエラーログにタイムゾーンのエラーが出るのを抑止するためphpの設定変更。

# vi /etc/php.in

date.timezone = 'Asia/Tokyo'

apache起動

service httpd start

ブラウザで以下にアクセスする
http://<インストールしたサーバのIPアドレス>/cacti/

Next⇒New Installを選択しNext⇒全てFOUNDになっていることを確認しNext
するとログイン画面が出てくるので、ログインする。
初期ユーザ名、パスワードはadmin,admin
f:id:monaski:20160919114119j:plain
これで使い始められる状態になりました。

以上でインストールは完了です。
次はcactiにログインし監視したい対象を登録します。