免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1219 | 回复: 0
打印 上一主题 下一主题

Cacti插件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-01-19 16:07 |只看该作者 |倒序浏览

一、Cacti插件

Cacti插件是对cacti的扩展。
要使用cacti插件必须先扩展cacti架构,来支持插件。
1.    安装cacti插件架构扩展
下载地址:
http://cactiusers.org/downloads/patches/
当前版本是V1.1,是专门针对cacti V0.8.6设计的。
1).解压下载的tar包,你会得到一个cacti-plugin-arch目录
# tar –zxvf cacti-plugin-arch.tar.gz
# cd cacti-plugin-arch
# ls

[/url]
2).有两中方法来安装cacti的插件架构扩展,第一种方法是使用patch文件,patch文件包含了原始文件与修改后文件的不同之处,所以可以使用patch文件来得到新的文件。第二种方法是使用pre-patched文件进行直接覆盖,将与cacti相对应版本的files-0.8.6*目录下的文件直接拷贝到cacti目录下进行覆盖。在此选择使用patch文件进行安装(这也是官网推荐的方法)。将与cacti相应版本的cacti-pligin-0.8.6*.diff文件拷贝到cacti目录下,然后使用patch命令进行安装。
# cp cacti-plugin-0.8.6j.diff /usr/local/apache/htdocs/cacti
//备份cacti目录,以备插件扩展安装失败后能恢复到原状态
# cd /usr/local/apache/htdocs
# cp –r cacti ./cacti.bak
# cd ./cacti
//首先使用以下命令进行测试
# patch -p1 -N --dry-run 0.8.6j.diff
//以上命令成功后,使用以下命令进行安装
# patch -p1 -N 0.8.6j.diff
3).安装后配置,首先查看你的cacti配置文件,看cacti相关的数据库信息是否被覆盖,如果被覆盖请直接从备份中拷贝一份到配置文件目录。
# cp ../include/config.php ./include/config.php
打开cacti配置文件,找到以下选项
$config['url_path'] = "/";
如过你的cacti能够在浏览器中使用以下方法直接访问,则不用修改cacti配置文件。
http://www.youdomain.com 或
http://cacti机器ip
           如果cacti在浏览器中使用以下方法直接访问,
           http://www.youdomain.com/cacti 或
           http://cacti机器ip/cacti
则$config['url_path'] = "/";必须被修改为$config['url_path'] = "/cacti/";
           注意前后的/不能丢。
           到此cacti插件结构的扩展完成,现在可以下载并安装你需要的cacti插件了。
     
1.    安装插件
插件的安装、升级、移除是很容易的,在安装插件前你必须以确保安装了cacti插件结构扩展。
1).下载插件,在此以Monitor插件为例。
      Monitor插件下载地址:
[url=http://cactiusers.org/downloads/]http://cactiusers.org/downloads/

      解压下载的tar包。
      # tar -zvcf monitor-0.7.tar.gz
      解压后你会得到一个monitor目录。
2).安装Monitor,只需要将monitor目录拷贝到cacti/plugins/目录下即可。如果是升级安装,只需要完全覆盖原monitor目录即可。
3).激活monitor插件,修改cacti配置文件(cacti目录下的include/config.php)。在配置中查找$plugins = array();行,在此行下面加入:
$plugins[] = 'monitor';
注意:上面monitor的名字必须与cacti/plugins/目录下插件目录的名字相同。
4).有些插件需要进行额外的配置,请根据插件的安装文档进行配置,在此略述。
5).移除插件时只要修改cacti配置文件,注释掉与插件相关的行即可。
如:
            //$plugins[] = 'monitor';
6).在console选项卡下,点击左侧菜单中的Settings链接,在右侧出现的web页中点击Misc选项卡来配置Monitor插件。
原文 :CactiUsers : tag ?>" href="http://cactiusers.org/wiki/PluginArchitectureInstall/backlinks">PluginArchitectureInstall

http://cactiusers.org/wiki/PluginArchitectureInstall

ConfigurationIt is necessary to configure your Cacti install after installing the Plugin Architecture for several reasons. First you will need to re-enter your database username and password (you can just pull the info out of your backup of your old includes/config.php). This is fairly straight forward and not necessary to cover here.
The other reason is that we now have a new config option which must be set inorder for your Cacti install to function properly. When you edit your includes/config.php you will see this option
$config['url_path'] = "/";
You will need to set this option to the URL location of your Cacti install. For instance, if you Cacti Install was reachable through a web browser at this location.
http://servername/
Then it would not be necessary to modify the above default location. But if your Cacti Install was at
http://servername/projects/cacti/testing/
then you would need to set the option to this
$config['url_path'] = "/projects/cacti/testing/";
or it may be located here
http://servername/cacti/
then you would need to set the option to this
$config['url_path'] = "/cacti/";

修改或者另一个文件
include/global.php




本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/45117/showart_467900.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP