Cacti 0.8.8b插件安装之weathermap

 

类别:原创 服务器php

本文参考html

http://www.360doc.com/content/14/1031/15/20148927_421444160.shtmlweb

 

第一:说明apache

目的:本机前提是已安装好了cacti 0.8.8b 并正常工做,本文档主要配置cacti插件weathermap服务器

其它说明: cacti 0.8.8b的安装请参考个人其它博客文章《Cacti 0.8.8b 安装配置(含snmp配置) http://jedy82.blog.51cto.com/425872/1569689ide

本文在此基础上配置字体

Cacti服务器ip:192.168.10.112ui

cacti 使用yum方式安装,默认路径为/usr/share/cactithis

第二:本例操做环境     spa

[root@i-tcz0hdhc ~]# yum update -y

[root@i-tcz0hdhc ~]# uname -a

Linux i-tcz0hdhc 2.6.32-431.29.2.el6.x86_64 #1 SMP Tue Sep 9 21:36:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

[root@i-tcz0hdhc ~]# more /etc/redhat-release 

CentOS release 6.6 (Final)

[root@i-tcz0hdhc ~]# 

第三:weathermap插件的安装

Cacti官方插件下载地址:http://docs.cacti.net/plugins

weathermap官方安装文档:http://docs.cacti.net/userplugin:weathermap

Weathermap下载地址: http://network-weathermap.com/files/php-weathermap-0.97c.zip

 

Weathermap必需要gd库的支持

[root@i-tcz0hdhc ~]#

[root@i-tcz0hdhc ~]# yum install -y php-gd

[root@i-tcz0hdhc ~]# service  httpd restart

[root@i-tcz0hdhc ~]# wget http://network-weathermap.com/files/php-weathermap-0.97c.zip

[root@i-tcz0hdhc ~]# unzip php-weathermap-0.97c.zip -d /usr/share/cacti/plugins

[root@i-tcz0hdhc ~]#

以后,再进入[Console]-[Configuration]-[plug Management],点击一下weatermap左边的蓝色向下箭头,直到变成红色向上的箭头。此时能够见到weathermap的Status为:active。说明weathermap已经运行。同时也能够见到[weathermap]的标签了,在 [console]-[Utilities]-[User Management],admin用户的Realm Permissions中也多了Plugin -> Weathermap: Configure/Manage 和Plugin -> Weathermap: View 两项,并已经选定。

第四:weathermap配置使用

安装好weathermap后,看到点Console在左边的列表里会看到weathermap的菜单,咱们点击,会看到设置,由于咱们尚未定义一个weathermap配置文件,因此咱们点右上角的Add按钮,添加一个weathermap配置文件


wps1938.tmp

点击Add以后,咱们看到有个文件,其实这个时候调用的就是weathermapconfigs目录下的文件,simple.conf就是自带的一个配置文件,咱们能够点击它前面的Add按钮,把他添加到默认配置文件里


wps1948.tmp

至此咱们添加了一个weathermap的配置文件,下面就是对weathermap进行配置了,点击weathermap,而后点击Editor对默认图形配置文件进行配置。


wps1959.tmp

点击Editor后咱们会看到以下提示


The editor has not been enabled yet. You need to set ENABLED=true at the top of editor.php


Before you do that, you should consider using FilesMatch (in Apache) or similar to limit who can access the editor. There is more information in the install guide section of the manual.


咱们按照提示修改editor.php文件


[root@i-tcz0hdhc ~]# vi /usr/share/cacti/plugins/weathermap/editor.php 


$ENABLED=false;改成 $ENABLED=true;


[root@i-tcz0hdhc ~]# 


以后咱们刷新页面收到以下页面的错误提示,这需受权容许httpd用户有权写入configs目录,不然没法编辑


The map config directory is not writable by the web server user. You will not be able to edit any files until this is corrected. [WMEDIT01]<p>


[root@i-tcz0hdhc ~]# chown -R apache.root /usr/share/cacti/plugins/weathermap/configs/ 


[root@i-tcz0hdhc ~]# 


最后咱们刷新页面就能够看到以下页面


wps1979.tmp

在这里咱们能够建立配置文件,或者从一个配置文件建立一个新的配置文件,或者打开一个已有的配置文件进行编辑,这里咱们就点击选择从simple.conf文件拷贝一个weathermap配置。命名为test.conf能够看到下图。注意本身建配置文件时 必定要加上.conf的后缀。


wps198A.tmp

这里就是weathermap的编辑页面了这里也能够经过[Console]-[Management]-[Weathermaps],而后点test.conf进入,把上面那个菜单说明下吧。


Change File能够会到前面的那个界面改变编辑的图形配置文件。


Add Node就是添加一个节点,点击以后鼠标会变成变成一个十字,在你想要放Node的地方点一下就能够建立一个Node


Add Link 就是添加添加一条连接,能够把二个Node链接起来,点击Add Link后点击Node,再点击另一个Node就能够把二个Node链接起来。


Position Legend是调整那个图列的位置,点击以后鼠标会编成十字,点击如下就能够移动到新的位置。


Postion Timestamp是添加一个图片建立的时间啊什么信息的。


Map Style 能够调整这个图形的风格。好比图形名称、.图形大小、图形背景图片、输出图片目录、位置等


基本使用的也就这几个了。


点击一个Node


wps198B.tmp

这里能够改Node的大小,Node的名称和标签名称,


Info URl是用户把鼠标放在这个Node后会出现一个流量图片,这个图片信息来自那里。


Hover Graph URL 这里是当用户点击这个Node是会跳转到那个图。在这里能够选择点击Pick From Cacti,从cacti中选取,


Icon Filename是图标的图像,这里能够有不少好比Router、Host、firewall。固然也能够本身添加,在weathermap的p_w_picpaths里,设置好有点击Submit就能够提交更改了.


 

咱们再设置如下Link,点击Link的那条线


Maximum Bandwidth Into这里是设置这条Link的最大带宽,这里根据你本身的具体配置设置了,这里端口是1G的端口,出口带宽是300MB所以我设置为300MB,


Maximum Bandwidth out 是出去的最大流量带宽,能够根据本身的具体状况设置。


Data source是流量从那里获取,这里能够引用mrtg的流量也能够点击Pick form Cacti从cacti里获取,


Info URl是用户把鼠标放在这个Node后会出现一个流量图片,这个图片信息来自那里,


Hover Graph URL 这里是当用户点击这个Node是会跳转到那个图,这个若是选择从cacti获取会自动取得。别的默认就成。这样咱们就我完成了对一张拓扑图的编辑。


wps199B.tmp

以下就是我设计的weathermap图像


wps19AC.tmp

注意问题


1,中文显示,咱们能够在配置文件里指定中中文字体的路径


vi /usr/share/cacti/plugins/weathermap/configs/test.conf


FONTDEFINE 100/usr/share/cacti/plugins/weathermap/msyh.ttf 10


msyh.ttf是中文字体的名字.须要用户本身加进去,指定路径,后面10字体是大小


2.每次对图形进行调整后,都是自动保存的,不用保存(也没有那个选项!嘿嘿),要在weathermap里看到修改后的效果要等到下次cacti采集器采集后才会绘图。


3.cacti的日志里可能会显示


WEATHERMAP: Poller[0] [Map 1] test.conf: About to write p_w_picpath file. If this is the last message in your log, increase memory_limit in php.ini [WMPOLL01]


等信息,不过我修改php.ini里的设置也不起做用,不用管它!


 

 

至此,weathermap已经安装成功。

相关文章
相关标签/搜索