大致的熟悉了cacti软件的相关界面以后,我继续学习关于插件的安装.

二、插件的安装
    由于功能上的需要可以采用各种各样的插件进行功能扩展,这篇学习笔记主要介绍了cacti的plugin architecture,以及network weathermap插件。

1、plugin architecture
1)plugin architecture简介
     在plugin architecture中有这么一段话:The Plugin Architecture for Cacti was designed to be both simple in nature and robust enough to allow freedom to do almost anything in Cacti. Cacti itself is designed nicely enough that integrating into it is fairly easy with very little modifications necessary.
    在安装插件前,必须把plugin architecture安装好,这样才支持其他插件的安装。
2)plugin architecture安装步骤:
#wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7e-PA-v2.6.zip
#unzip cacti-plugin-0.8.7e-PA-v2.6.zip
#cd cacti-plugin-arch/
#mysql -p cacti<pa.sql                         //导入数据库数据
#cp cacti-plugin-0.8.7e-PA-v2.6.diff /usr/local/apache2/htdocs/cacti/
#patch -p1 -N<cacti-plugin-0.8.7e-PA-v2.6.diff  //在cacti目录下打上补丁
#cd /usr/local/apache2/htdocs/cacti/
#vi include/global.php                              //修改相关的配置

vi include/global.php
主要修改
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "2010";
$database_port = "3306";          //以上设置是与数据库连接的参数

$config['url_path'] = '/cacti/';    //这个地方修改非常重要。。他表示在那个url地址进行搜索相关的插件。

通过以上的安装和修改,就完成对plugin architecture安装。
注意:在安装完成以后会在主页面上的左边configuration多了一个plugin management选选项。如图:

如果没有出现该选项。则应该到utility -> user management然后选择用户admin
进入admin用户的设置项 Realm Permissions ,勾上plugin management,然后保存,如图:


2、network weathermap

1)network weathermap简介
PHP Weathermap is one of many implementations of the same basic idea - take data from your network devices and use it to provide a single-page overview of the current state of network, like the one to the right. It complements a tool like MRTG, Cricket or Cacti, that provide in-depth graphing, and historical information, and can use data from those systems to produce it's maps. In fact, it requires some other data-collection source, as it does no device-polling on it's own.以上介绍来至http://www.network-weathermap.com/

2)安装
a.安装的需求:weathermap做为cacti的插件进行安装必须要先安装plugin architecture 。
b.下载插件并解压
cd  /usr/local/apache2/htdocs/cacti/plugins
wget http://www.network-weathermap.com/files/php-weathermap-0.96a.zip
unzip php-weathermap-0.96a.zip
c.文件赋权
cd plugin/
chown cacti output
d.激活插件
vi /usr/local/apache2/htdocs/cacti/include/global.conf
代码如下:
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cacti";
$database_password = "2010";
$database_port = "3306";     //确认连接数据库的参数准确无误

$plugins[] = 'weathermap';
$config = array();
e.修改相关文件选项的属性
cd /usr/local/apache2/htdocs/cacti/plogins/weathermap/
cp editor-config.php-dist editor-config.php
vi config.php     //确保$cacti_base、$cacti_url设置正确

chown deamon configs     //deamon是apache 服务运行的账号
chmod u+w configs
到此,就安装完毕了!! ^_^多了一个weathermap的选项卡!!截个图秀一下。