斑竹网络专注为中小企业客户提供以管理服务为核心的IT全方位服务 https://www.sysadm.cn
分类: LINUX
2013-12-13 11:46:06
(环境:Linux localhost 2.6.9-67.ELsmp)
(Nagios版本:cacti-0.8.7e.)
(整理日期:2012-07-09)
# wget
# tar -zxvf cacti-0.8.8a.tar.gz
# cd cacti-0.8.8a
# mysql
Mysql> create database cacti default character set=’utf8’;
mysql> grant all on cacti.* to ‘cactiuser’@’localhost’ identified by ‘mko09ijn’;
mysql> quit;
# mysql cacti <cacti.sql
# mkdir /apache_www/cacti_weejoy_com
# cp -Rpf * /apache_www/cacti_weejoy_com/
# chown -R apache: /apache_www/cacti_weejoy_com
# vi /etc/httpd/conf.d/http-vhost.conf
ServerAdmin wayne.wang@weejoy.cn
DocumentRoot /apache_www/cacti_weejoy_com
ServerName cacti.weejoy.com
AddDefaultCharset utf8
ErrorLog /apache_logs/cacti.weejoy.com_error_log
CustomLog /apache_logs/cacti.weejoy.com_access_log common
AllowOverride all
Order allow,deny
Allow from all
# wget
# tar -zxvf rrdtool-1.4.7.tar.gz
# cd rrdtool-1.4.7
# ./configure
# make
# make install
# ln -s /opt/rrdtool-1.4.7/bin/rrdtool /usr/local/bin/rrdtool
# rpm –ihv net-snmp-5.3.2.2-5.el5.i386.rpm
# rpm –ihv net-snmp-libs-5.3.2.2-5.el5.i386.rpm
# rpm –ihv net-snmp-utils-5.3.2.2-5.el5.i386.rpm
#rpm –ihv net-snmp-devel-5.3.2.2-5.el5.i386.rpm
#rpm –ihv net-snmp-perl-5.3.2.2-5.el5.i386.rpm
用游览器打开:,然后按照提示安装
cacti-plugin-arch插件的安装:
wget
mv cacti-plugin-0.8.7-PA-v1.2.zip cacti-plugin-0.8.7-PA-v1.2.tar.gz
tar -zxvf cacti-plugin-0.8.7-PA-v1.2.tar.gz
cd cacti-plugin-arch
cd files-0.8.7/
cd ..
cp cacti-plugin-0.8.7-PA-v1.2.diff /jongo/news/www/cacti/
cd /jongo/news/www/cacti
patch -p1 -N < cacti-plugin-0.8.7-PA-v1.2.diff
cd include
vi config.php
将$config["url_path"] = "";修改成:
$config["url_path"] = "/cacti/";
注:
上面这个版本在安装了下面的这个版本的插件不好用,改用V2.5版的
wget
unzip cacti-plugin-0.8.7e-PA-v2.5.zip
cp cacti-plugin-0.8.7e-PA-v2.5.diff cacti/
cd cacti
patch -p1 -N < cacti-plugin-0.8.7e-PA-v2.5.diff
cd ..
mysql -h192.168.2.2 -ucacti -pcacti cacti < pa.sql
重新安装了以后,很多的图片及css文件找不到,要修改
vi cacti/include/global.php
将$config['url_path'] = '';修改成:
$config['url_path'] = '/cacti/';
Settins 插件的安装
这个插件的目的:为cacti的插件机制提供通用的插件服务结构,即如果按装其它插件,就需要安装这个插件
下载地址:
# tar -zxvf settings-latest.tgz
# mv settings-0.6 cacti/plugins/settings
# vi cacti/include/global.php
添加如下行:
$plugins[] = 'settings';
thold插件的安装
这个插件的目的是发送警报信息用的。
下载地址:
# tar -zxvf thold-latest.tgz
# mv thold-0.41 cacti/plugins/thold
# cd cacti/plugins/thold/
# mysql -h192.168.2.2 -ucacti -pcacti cacti
将数据库里的信息导进去
安装好了以后,仍然不能出来,
修改
# vi include/plugins.php
将$function = "plugin_init_$name"; 修改成:
$function = "plugin_".$name."_install";
就可以出来了
Cacti支持的网址: