分类: LINUX
2008-09-24 12:35:53
首先要做的是安装一个 mandatory 插件,它必须在安装其它插件前被安装,它被称为 "基础" 插件。
- 对于 Cacti 0.8.6i & j,它可以在 cactiusers.org 网页上被 (1.1)。
- 对于 Cacti 0.8.6h, 它可以在我们的网页上被 (1.0)。
如果你使用 apt (软件包安装) 安装 cacti,你可能知道你的 cacti 版本通过 "apt-cache policy cacti" 命令。
解压你刚刚下载的文件。
#tar -xvf /home/user/Desktop/cacti-plugin-arch.tar.gz |
#cp /home/user/Desktop/cacti-plugin-arch/* /usr/share/cacti/site/ -R #cd /usr/share/cacti/site/ |
#patch -p1 -N < cacti-plugin-0.8.6h.diff |
#patch -p1 -N < cacti-plugin-0.8.6i.diff |
#patch -p1 -N < cacti-plugin-0.8.6j.diff |
CACTI 插件:
1. (v 0.1) | 2. (v 0.82) | 3. (v 0.4) |
NTop 是一个提供网络使用的统计资料的工具。
#apt-get install ntop |
#tar -xvf /home/user/Desktop/ntop-0.1.tar.gz |
#cp /home/user/Desktop/ntop /usr/share/cacti/site/plugins/ -R |
$plugins[] = ‘ntop’; |
ntop -u user -w 3000 |
登录到你的 cacti 界面 -> 在控制标签页上点击 -> 在 "Utilities" 选项上 点击 "User Management" -> 点击一个用户 -> 启用这个 "View NTop" 复选框。 |
更多关于 PHP Weathermap 的信息,参考 。
并解压到 weathermap 目录。在你下载的 Weathermap 的位置输入下列命令:
#tar -xvf /home/user/Desktop/php-weathermap-0.82.zip |
#cp /home/user/Desktop/weathermap/ /usr/share/cacti/site/plugins -R |
$plugins[] = ‘weathermap’; |
登录到你的 cacti 界面 -> 点击 console 标签页 -> 在 "Utilities" 选项上点击 "User Management" -> 点击一个用户 -> 启用 "View Weathermaps" 复选框。 |
一个印象深刻的插件用于读取 syslog-ng 信息
#tar -xvf /home/user/Desktop/haloe-0.4.tar.gz |
#cp /home/user/Desktop/haloe /usr/share/cacti/site/plugins/ -R |
$plugins[] = ‘haloe’; |
#apt-get install syslog-ng |
# use the following line if you want to receive remote UDP logging messages # (this is equivalent to the "-r" syslogd flag) udp(); |
log { source(s_all); destination(d_mysql); }; # pipe messages to /var/log/mysql.pipe to be processed by mysql destination d_mysql { pipe("/var/log/mysql.pipe" template("INSERT INTO syslog_incoming (facility, priority, date, time, host, message, seq, status) VALUES ( '$FACILITY', '$PRIORITY', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$HOST', '$MSG', '$SEQ', '$STATUS' );\n") template-escape(yes)); }; |
#mysqladmin -u root -p create haloe #mysql -u root -p haloe < /home/user/Desktop/haloe/syslog.sql |
#mysql -u root -p haloe >GRANT ALL ON haloe.* TO haloeuser@localhost IDENTIFIED BY 'haloepassword'; >flush privileges; |
$haloedb_type = "mysql"; $haloedb_default = "haloe"; $haloedb_hostname = "localhost"; $haloedb_username = "haloeuser"; $haloedb_password = "haloepassword"; |
$haloe_colors["emerg"] = "FF0000"; $haloe_colors["crit"] = "FF0000"; $haloe_colors["alert"] = "FF0000"; $haloe_colors["err"] = "FFAB00"; $haloe_colors["warning"] = "FFFF00"; $haloe_colors["notice"] = "FFAB00"; // $haloe_colors["info"] = "FFAB00"; // $haloe_colors["debug"] = "D0D0D0"; |
#mkfifo /var/log/mysql.pipe |
#!/bin/bash if [ ! -e /var/log/mysql.pipe ] then mkfifo /var/log/mysql.pipe fi while [ -e /var/log/mysql.pipe ] do mysql -u haloeuser --password=haloepassword haloe < /var/log/mysql.pipe >/dev/null done |
#/usr/share/cacti/site/plugins/haloe/syslog2mysql.sh |
#chown user /etc/cacti/debian.php |
#ls -l | grep debian.php -rw-r----- 1 user www-data 557 2006-11-18 14:00 debian.php |
#su user user@linux#/usr/share/cacti/site/plugins/haloe/syslog2mysql.sh |
crontab -e -u user # when the computer boots, it starts automatically the syslog2mysql.sh script. @reboot /usr/share/cacti/site/plugins/haloe/syslog2mysql.sh # A command required to transfer the data stored # into the syslog_incoming table to the syslog table. (every 1 minute) # For an unknown reason this is not done automatically by the syslog plugin. */1 * * * * php5 -q /usr/share/cacti/site/plugins/haloe/syslog_process.php |
登录到你的 cacti 界面 -> 点击 console 标签页 -> 在 "Utilities" 选项上点击 "User Management" -> 点击一个用户 -> 启用 "View Syslog" 复选框。 |