您的位置:首页 > 其它

安装cacti插件

2014-08-11 17:37 429 查看
插件下载地址:http://docs.cacti.net/templatesmonitor插件,提供更简略、直观的设备状态图示;监视器thold插件,提供设备异常预警。阈值syslog插件,提供cacti日志监控服务settings:给不同的插件提供一些共用的信息,如邮件信息,dns信息weathermap:绘制网络拓扑的插件,气象图discover:的功能就是让cacit自动发现主机,自动加入主机,自动画图monitor插件的安装#tar zxvf monitor-0.8.2.tar.gz#mv monitor
/usr/local/wwwroot/cacti/plugins/点击console ->Plugin Management->在Actions处启用Monitor进入"User Management"->点admin->Realm Permissions->勾选View Monitoring ,至此Monitor插件安装完成。thold插件的安装#tar zxvf thold-0.4.3.tar.gz#mv thold /usr/local/wwwroot/cacti/plugins/点击console
->Plugin Management->在Actions处启用thold点击console ->Settings->Misc->Monitor->Grouping设置tree->View设置list,这时点击thold选项点击设备可以看到流量图settings插件的安装#tar zxvf discovery-0.8.5.tar.gz#mv settings /usr/local/wwwroot/cacti/plugins/点击console ->Plugin Management->在Actions处启用settingsdiscovery插件的安装#tar
zxvf discovery-0.8.5.tar.gz#mv discovery /usr/local/wwwroot/cacti/plugins/点击console ->Plugin Management->在Actions处启用discovery进入"User Management"->点admin->Realm Permissions->勾选View Host Auto-Discovery ,至此discovery插件安装完成weathermap插件的安装#uzip php-weathermap-0.97a.zip#mv
weathermap /usr/local/wwwroot/cacti/plugins/#chown -R apache.apache /usr/local/wwwroot/cacti/plugins/weathermap对weathermap的配置文件进行修改#cd /usr/local/wwwroot/cacti/plugins/weathermap#chmod u+w config/#cp editor-conifg.php-dist editor-config.php#vi editor-config.php$cacti_base
= "/usr/local/wwwroot/cacti";$cacti_url = "http://222.186.43.15/cacti";$mapdir= $cacti_base .' /plugins/weathermap/configs';$ignore_cacti = FALSE;将editor.php中的ENABLED=false修改为true,否则weathermap点击Editor时会报错#cd /usr/local/wwwroot/cacti/plugins/weathermap#vi editor.php//$ENABLED=false;将false修改为true$ENABLED=true;点击console
->Plugin Management->在Actions处启用weathermap,至此weathermap插件安装完成。syslog插件的安装1.安装syslog-ng服务#rpm -ivh syslog-ng-2.1.4-1.el5.i386.rpm2.安装syslog插件#tar zxvf syslog-0.5.2.tar.gz#mv syslog /usr/local/wwwroot/cacti/plugins/点击console ->Plugin Management->在Actions处启用syslog进入"User
Management"->点admin->Realm Permissions->勾选View Syslog和Configure Syslog Alerts / Reports#mysql -uroot -pmysql>create database syslog; 创建一个数据库供syslog使用mysql>use syslog;mysql>source /usr/local/wwwroot/cacti/plugins/syslog/syslog.sql 导入mysql数据库mysql>grant all
on syslog.* to cacti@localhost identified by 'cacti';添加一个数据库账号cacti 密码为cacti用以访问syslog库mysql>flush privileges;#cd /usr/local/wwwroot/cacti/plugins/syslog#vi config.php$syslogdb_type = 'mysql';$syslogdb_default = 'syslog';$syslogdb_hostname = 'localhost';$syslogdb_username
= 'cacti';$syslogdb_password = 'cacti';#vi /etc/syslog-ng/syslog-ng.conf 在最后末尾添加如下:source net {udp();};destination d_mysql {pipe("/tmp/mysql.pipe"template("INSERT INTO syslog_incoming (host, facility, priority, date, time, message) VALUES ( '$HOST', '$FACILITY',
'$PRIORITY', '$YEAR-$MONTH-$DAY', '$HOUR:$MIN:$SEC', '$MSG' );\n")template-escape(yes));};log { source(net); destination(d_mysql); };log { source(s_sys); destination(d_mysql); }; 完成之后,执行#service syslog restart#service syslog-ng restart在syslog插件目录下,编辑一个新的sh文件/plugins/syslog/syslog2mysql.sh,并且赋予可执行权限(同时该目录下syslog_process.php也必须有可执行权限):#vi
/usr/local/wwwroot/cacti/plugins/syslog/syslog2mysql.sh 输入#!/bin/bashif [ ! -e /tmp/mysql.pipe ]thenmkfifo /tmp/mysql.pipefiwhile [ -e /tmp/mysql.pipe ]do mysql -u root syslog < /tmp/mysql.pipe >/dev/nulldone运行syslog2mysql.sh,如果没有任何显示,后台有该进程,则基本上成功了。在/etc/crontab中添加:@reboot
/usr/local/wwwroot/cacti/plugins/syslog2mysql.sh*/1 * * * * php /usr/local/wwwroot/cacti/plugins/syslog_process.php使开机执行syslog2mysql.sh,每分钟执行一次syslog_process.php

原文地址http://blog.sina.com.cn/s/blog_73dac6b50101h06b.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: