プラグインインストール
プラグインを利用するためには、プラグインを利用するための「Plugin Architecture」と呼ばれるパッチを適用する必要があります。このパッチはパッケージ化されていないため、手動でダウンロード・適用する必要があります。
また、プラグインを利用する場合は、Cacti のインストールをパッケージから行わずに直接配置した方が簡単に適用できます。
※現状 0.8.7 系ではプラグインを利用するためにプラグインアーキテクチャというパッケージ(パッチ)をインストールする必要がありますが、0.8.8(2008年3Qリリース予定) からは Cacti 自体に組み込まれる予定です。
Plugin Architecture のダウンロード
下記のページから Plugin Architecture をダウンロード
http://cactiusers.org/downloads/patches/
$ cd <適当な作業用ディレクトリ> $ wget http://cactiusers.org/downloads/cacti-plugin-arch.zip
Plugin Architecture の適用
$ unzip cacti-plugin-arch.zip
※インストールの詳細は展開した中にある Readme.txt を参照
※または、下記のページを参照
http://cactiusers.org/wiki/PluginArchitectureInstall
- パッチファイルのコピー
Debian にて Cacti のコンテンツがインストールされるのは /usr/share/cacti/siteなので、ここに、プラグイン用のパッチをコピーする。
# cp cacti-plugin-0.8.7a-PA-v1.4.diff
- パッチの適用
# patch -p1 -N < cacti-plugin-0.8.7a-PA-v1.4.diff
patching file auth_changepassword.php
patching file auth_login.php
patching file data_sources.php
patching file graph_image.php
patching file graph.php
patching file graphs_new.php
patching file graphs.php
patching file host.php
patching file include/auth.php
patching file include/global_arrays.php
patching file include/global_form.php
patching file include/global.php
patching file include/global_settings.php
patching file include/plugins.php
patching file include/top_graph_header.php
patching file include/top_header.php
patching file index.php
patching file lib/api_device.php
patching file lib/functions.php
Hunk #1 succeeded at 1528 (offset 52 lines).
Hunk #3 succeeded at 1618 (offset 52 lines).
patching file lib/html_form.php
patching file lib/html.php
patching file lib/html_tree.php
patching file lib/poller.php
patching file lib/rrd.php
patching file lib/variables.php
patching file plugins/index.php
patching file poller.php
patching file user_admin.php
patching file utilities.php
- Config ファイルの修正
# cd /var/www/cacti/include # vi global.php 下記の行を見つけて、実際のパスを入力する(/cacti/)など $config['url_path'] = '/';
Debian パッケージでインストール
パッケージリストの更新
# apt-get update
パッケージ確認
# apt-cache search cacti cacti - Frontend to rrdtool for monitoring systems and services cacti-cactid - Multi-Threading poller for cacti
2008年1月現在では上記二つのパッケージがある。
RPM でのインストール
パッケージ
- 主に必要な rpm パッケージ
パッケージ名 | 今回インストールしたパッケージバージョン |
httpd | 2.2.3-11.el5.centos |
php | 5.1.6-15.el5 |
php-mysql | 5.1.6-15.el5 |
php-snmp | 5.1.6-15.el5 |
mysq | 5.0.22-2.2.el5_1.1 |
mysql-server | 5.0.22-2.2.el5_1.1 |
net-snmp | 5.3.1-19.el5_1.3 |
rrdtool | 1.2.23-1.el5.rf |
cacti | 0.8.7a-1.el5.rf |
cacti-cactid(cacti-spine) | 0.8.7-1.el5.rf |
yum を使ったインストール
# yum install httpd
# yum install php
# yum install php-mysql
# yum install php-snmp
# yum install mysql
# yum install mysql-server
# yum install net-snmp
Cacti インストール
※ rrdtool や cacti は CentOS のパッケージサーバから提供されていないため、rpmforge から直接 rpm ファイルを取得するか、yum にレポジトリを追加するかして取得します。
rpmforge を使うには、rpmforge-release package をインストールする必要があります。
# wget http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm # rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm http://dag.wieers.com/rpm/FAQ.php#B1 # yum install rrdtool
- cacti インストール
# yum install cacti
※ rrdtool の際と同様に rpmforge の設定を行っておく必要があります。
- cactid(spine) インストール
# yum install cacti-cactid もしくは # yum install cacti-spine
※ rrdtool の際と同様に rpmforge の設定を行っておく必要があります。
※不必要なパッケージがインストールされてしまう前に rrdtool と cacti をインストールした後は rpmforge の設定を解除したほうがいいと思われます。
Official Patch
下記のページからパッチをダウンロード
http://www.cacti.net/download_patches.php
# cd /var/www/cacti # wget http://www.cacti.net/downloads/patches/0.8.7a/graph-issue-wrra-specs.patch # wget http://www.cacti.net/downloads/patches/0.8.7a/cmd-php-non-unique-hosts.patch # patch -p1 -N < graph-issue-wrra-specs.patch patching file lib/functions.php # patch -p1 -N < cmd-php-non-unique-hosts.patch patching file cmd.php
MySQL DB 作成
- MySQL の起動
# /etc/init.d/mysql start
- root アカウント設定
※ここからは root でも user でも実施可能 $ mysqladmin --user=root password$ mysqladmin --user=root --password reload Enter password: <--設定したパスワードを入力
- cacti 用の DB 作成
$ mysqladmin -p --user=root create cacti Enter password: <--root のパスワードを入力 $ cd /var/www/cacti $ mysql -p --user=root cacti < cacti.sql Enter password: <--root のパスワードを入力
- cacti 用のユーザ作成
$ mysql --user=root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -AWelcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 50 to server version: 5.0.22Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cacti';
Query OK, 0 rows affected (0.00 sec)mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)mysql> quit
Bye
- cacti の設定ファイル編集
# cd /var/www/cacti/include # vi config.php $database_type = "mysql"; $database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cacti";
- Spine(cactid) の設定ファイル編集
# vi /etc/spine.conf spine の config も cacti と同様に設定 DB_Host localhost DB_Database cacti DB_User cactiuser DB_Pass cacti DB_Port 3306