说明:
Weathermap是cacti中最常用的插件之一,用它可以画出漂亮的网络拓扑图!同时Weathermap也是一个独立工具,可以独立部署,不需要cacti的支持,也可以部署.下面首先来看一看用Weathermap画出来的拓扑图。
安装:
1.获取WeatherMap
# cd /usr/local/src/cacti_plugins # wget http://www.network-weathermap.com/files/php-weathermap-0.97a.zip //官方最新的是php-weathermap-0.97c.zip,Apr 10, 2013,我这里使用的是php-weathermap-0.97a.zip,Mar 9, 2010。 # unzip php-weathermap-0.97a.zip # mv weathermap /home/www/data/cacti/plugins //将解压出来的weathermap文件夹移到cacti下的plugins目录 # chown -R www.www /home/www/data/cacti/plugins/weathermap/
2.复制weathermap目录下的editor-config.php-dist为editor-config.php,修改editor-config.php
# cd /home/www/data/cacti/plugins/weathermap # cp editor-config.php-dist editor-config.php # vim editor-config.php //修改cacti_base,cacti_url为实际位置 $cacti_base = '/home/www/data/cacti'; $cacti_url = "http://cacti.gaingreat.com:8181/cacti/"; //记得以/结尾
3.进入CACTI,Console | Utilities | User Management,选择管理员用户,在“Realm Permissions”里,勾选View WeatherMap和Configure WeatherMap。因为我cacti版本是0.8.8a,默认已经勾选
4.安装weathermap插件
console | Plugin Management | 选择weathermap,如下图
5.修改cacti站点目录下include/config.php,添加weathermap,
# vim /home/www/data/cacti/include/config.php //在//$cacti_session_name = "Cacti";后添加$plugins[]='weathermap';
这里,一定要先在console | Plugin Management | 安装weathermap后再修改include/config.php文件,不然在第4步会一直提示please uninstaled weathermap。
include/config.php文件添加$plugins[]=’weathermap’;要记得这个分号,不然在cacti的weathermap添加连接data source时会出现Undefined property: stdClass::$name等。具体见附录1:cacti的weathermap添加连接data source时,会出现下面这些
到这里,weathermap已经安装完成。
删除weathermap插件,只需要
删除/home/www/data/cacti/plugins/weathermap目录
将/home/www/data/cacti/include/config.php中的$plugins[]=’weathermap’;注释掉即可!
附录:
附录1:cacti的weathermap添加连接data source时,会出现下面这些
Notice: Undefined property: stdClass::$name in /home/www/data/cacti/plugins/weathermap/Weathermap.class.php on line 3326 Notice: Undefined property: stdClass::$defined_in in /home/www/data/cacti/plugins/weathermap/Weathermap.class.php on line 3328 Notice: Undefined property: stdClass::$name in /home/www/data/cacti/plugins/weathermap/Weathermap.class.php on line 3326 Notice: Undefined property: stdClass::$defined_in in /home/www/data/cacti/plugins/weathermap/Weathermap.class.php on line 3328
这主要是因为cacti目录/include/config.php没有添加$plugins[]=’weathermap’;这句,或少个分号,导致没有$name,$defined_in这些组未定义
附录2.weathermap官方下载地址:http://www.network-weathermap.com/download