基于 Centos 5.2.. 的 Cacti 安装全攻略 杀毒
Author:liheng
Cacti 简介(来自Cacti 官方网站).:电影
. Cacti is a complete networ.k graphing solution designed to harness the powe.r of RRDTool's data storage and graphing functionality. Cacti provides a fast poller, adva.nced graph templating, multiple data acquisi.tion me.thods, and user management feature.s out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex network.s with hun.dreds of devic.es. 女人
Data Sources
To handle data gathering., you can fe.ed cacti the paths to any external script/co.mmand along wit.h any data tha.t the user will need to "fill in", cacti will then gather this data in a cron-job and populate a MySQL databas.e/the round robin archives. 婚庆
Data Sources can also be created, which correspond to actual data on the graph. For instance, if a user would want. to. graph the ping times to a host, y.ou could crea.te a data .source utili.zing a script that pings a host and returns it's value in milliseconds. After .defining options for RRDTool such as how t.o store the data you will be able to d.efine any additional information that the data input source requires, such .as a host to ping in th.is case. Once a data source is created, it is automatically maintained at 5 m.inute intervals. 电子
Graphs
Once one or more data. sources are defined, an RRDTo.ol graph can be created using .the data. Cacti allows you to create almost any. imaginable RR.DTool graph using all of the. sta.ndard RRDTool graph types and consolidation functions. A color selection ar.ea and automatic text padding function also aid in the creation of graphs to make the process easier. 外汇
Not only can you create RRDTool based graphs in cacti, but there a.re many ways to display them. Along with a standard "list view" and a "preview .mode", which resembles th.e RRDTool fr.onte.nd 14all, there is a "tree view", which allows you to put graphs onto a hi.erarchical tree for organizati.onal purposes.电脑
User .Management学习
Due to the many functions of cacti, a user based management tool is built in so you can ad.d users and give them rights to certain area.s of cacti. This would allow someone to create some users that can c.hange graph param.eters,.. while .other.s can only view graphs. Each user also maintains their own settings when it comes to viewing graphs.外贸
Templating
Lastly, cacti is able to scale to a large number of data sources and grap.hs through the use of templates. This allows the creation of a single graph. or data s.ource template which defin.es any graph or data source associate.d with it. Host templates enable you to defin.e the capabilitie.s of a host so cacti can poll it for information upon the a.ddition of a new host.教育
一、Cacti 安装
测试的环境使用 VMWa.re Workstation 6.5.,网络环境介绍: 汽车
序号 IP地址 . 角色虚拟主机
1. 192.168.98.240 Cac.ti 服务器,安装CentOS5.2.
2 192..168.98.204 用于监控的W.indows 主机安装系统为 Windows Server 2003学习
3 . 192.168.98.241 用于监控的 Linux 主机,安装Cen.tOS5.2 健康
在确定你要安装 Cacti.之前,首先请确保你的系统已经安装了以下程序包:..
http
Php
Php-mysql
Php-snmp
Mysql
Mysql-server
Perl-DBD-MySQL
Php-pdo
Net-snmp
Net-snmp-libs
Net-snmp-utils
如果你不能确定你的系统中是否已经安装了以上软件程序包,.可以使用“ rpm -qa 程序包名称”,如查询 http ,使用“ rpm -qa htt.p ”命令查询,安装.了的话,就会显示已经安装的程序包名称,未安装,无显示。.
如http与mysql是已经安装好的,请确保http 与 mysql 服务是开机.自启动的。如果没有,请使用.以下命令使其开机自启动。学习
[root @heng ~] # chkconfig —level .35 mysqld. on 外汇
[root @.heng ~] # chkconfig —lev.el 35 httpd on电影
修改 apache 配置文件
[root @heng.. ~] # vi /etc/httpd/conf/httpd.conf服务器
# 找到 A.ddType 添加如下二行 鲜花
AddType a..pplication/x-httpd-php .php学习
AddType app.lication/x-httpd-ph.p-source .phps.
# 定位至DirectoryIndex index.h..tml 建材
&nbs.p; 修改为: 汽车
.DirectoryIndex index.php&n.bsp; index.html 杀毒
启动 mysql .与 http 服务--------------彩票
[root @heng ~] # se.rvice mysqld. start.
[ro.ot @heng ~] # servi.ce httpd start外贸
安装 rrdtool
到rrdtool 网站:
http://oss.oetiker.ch/rrdtool/ 下载安装文件,现最新的安装文件版本是:rrdtool-1.3.37外贸
[r.oot @heng ~] # tar xvzf rrdtool-1.3.37.tar..gz.
[root @hen.g ~] # cd rr.dtool-1.3.37 外汇
[ro.ot @heng rrdtool] # ./configure —prefix=/usr/.local/rrdtool 鲜花
[root @heng .rrdtool] # .make.
[root @heng .rrdtool] # make install. 健康
[root. @heng rrdtool] # cd虚拟主机
[root @heng ~] # c.d--------------彩票
修改系统中的 snmp 设置
[r.oot @heng ~] # vi. /etc/snmp/snmp.conf
将
com2secnotConfigU.ser default pu.blic( 游戏 )
改为:
c.om2secnotConfig.User 127.0.0.1 public .
将
access notConfigGroup "" any &nbs.p;noauth exact systemvi.ew none&nbs.p;no.ne( 游戏 )
改为:
ac..cessnotConfigGroup""anynoauthexact all none none学习
#view&n.bsp;all included .1&nbs.p; &.nbsp; 80 汽车
将前面的 # 注释&nbs.p;去掉。.
重新启动 snmp 服务
[roo.t @heng. ~] # service snmpd restart .
安装 cacti
[root @heng ~] # tar .xzvf cacti-0.8.7d..tar.gz.
[.root @heng ~] # mv cacti-0.8..7d /var/www/html/cacti 婚庆
设置目录权限 , 避免因权限.问题而导致目录无法写入.
[root @heng ~] # c.hmod. 777 -R /var/www/html/cacti 电子
在Mysql中创.建一个用于存储Cacti信息的数据库,这里我将数据库名称命名为cacti,新.建一个数据库用户cacti ,设置密码为 cacti ,并赋予该用户对数据库cacti完全控制权限.。导入 美容
/var/ww.w/html/cacti目录中cacti.sql 生成cacti 数据库结构,然后编辑 cacti 的数据库配.置文件。.
进入数据库
[root @.heng ~] # mysql<性病>
Mysql >. CREATE .DATABASE cacti;电脑
Mysql > insert into mysql.user(Ho.st,U.ser,Password) values(“localhost”,”cacti”,p.assword(“cacti”));.
Mysql > .flush privileges;.
Mysql > grant all .privileges on cacti.* to
cacti@local.host. identified by ‘cacti’;--- 印刷
Mysql > grant all privileges on cacti..* to cacti@127.0..0.1 identified by ‘cact.i’;--- 印刷
Mysql .>flush privileges; 鲜花
Mysql > quit
导数据进数据库
[root @heng ~] # mys.ql -u cacti -p cacti < /var/ww/html./cacti/cacti.sql健康
Ent.er password: 乙肝
输入MyS.QL用户cacti 的密码 .
修改 cacti. 数据库配置文件.
[root @heng ~] # vi /var/ww/html/cacti/in..clude/config.php.
将
$data.base_type= “ mysql ” ; .电脑
$database_default .= “数据库名称.” ; ( 游戏 )
$database_hostname&n.bsp;= “默认是 localhost. ” ; 外贸
$database_us.ername = “用户名.” ; ( 游戏 )
$data.bas.e_password = “密码” ;电脑
修改成:
$database_type= “. .mysql ” ; 汽车
$databas.e_default&nb.sp;= “cacti” ; 婚庆
$database_hostname&n.bsp;= “. localhost ” ; 电影
$database_usernam.e = .;“cacti” ; 汽车
$database_pas.sword =. “cacti” ; 鲜花
因为 cacti 在查找rrdtool 的 Binary path 时默认是在 /bin 、/sbin、/usr/bin、/usr/sbin、/u.sr/local/bin/ 、/usr/local/sbin 目录下查找的,而我的 rrdtool 是自己指定安装在 /usr/local/rrdtool 目录下,.并且我在安装的时候并没有指定 rrdtool的 Binary path 安装在 c.acti 默认查找的目录下.,由此在你第一次开始通过浏览器进入 cac.ti ,在设置 rrdtool、php、snmp工具路径时,你会发现 c.acti 提示 rrdtool 路径是没有找到的,就算你手工修改也一样提.示没有找到,如图: 女人
cacti-004.jpg. (83.67 KB) <性病>
下载次数:8
2009-05-1.3 12:30服务器
http://upload.bbs.csuboy.com/Mon_1004/126_6982_08471836913d2d2.jpg[/img].