一:cacti简介 Cacti 在英文中的意思是仙人掌的意思,Cacti是一套基于PHP,MySQL,SNMP及RRDTool开发的网络流量监测图形分析工具。它通过snmpget来获取数据,使用 RRDtool绘画图形,而且你完全可以不需要了解RRDtool复杂的参数。它提供了非常强大的数据和用户管理功能,可以指定每一个用户能查看树状结 构、host以及任何一张图,还可以与LDAP结合进行用户验证,同时也能自己增加模板,功能非常强大完善。
二:安装
Cacti是运作在apache+php+mysql+net-snmp工具集+rrdtool这样的一个工作环境之下,所以我们先要做一个基本的工作的环境
#yum -y install mysql mysql-server php-mysql httpd php
#安装环境所需软件包.
service mysqld start
service httpd start
chkconfig mysqld on chkconfig httpd on
#启动相关服务.
#yum install net-snmp*
#这里要安装完全,否则没有snmpwalk命令.这个命令是用来测试snmp的,非常有用.
#yun insatll cacti
#安装cacti
#安装完成之后默认会在/etc/httpd/conf.d/下面生成cacti.conf配置文件,这时需service httpd restart重启apache配置才会生效.
1)
我们看下cacti.conf配置文件,顺便温习下apache的有关内容
Alias /cacti /usr/share/cacti
#这里是cacti文件存放的目录,下面会用到.
# httpd 2.4
Require host localhost
# httpd 2.2
Order deny,allow
Deny from all
#Allow from localhost
Allow from all
#这里允许所有机器访问
# mod_security overrides.
# Uncomment these if you use mod_security.
# allow POST of application/x-www-form-urlencoded during install
#SecRuleRemoveById 960010
# permit the specification of the rrdtool paths during install
#SecRuleRemoveById 900011
Require all denied
Order deny,allow
Allow from all
#Deny from all
Require all denied
Order deny,allow
Allow from all
#Deny from all
2)数据库配置
#mysql -uroot -p
mysql>create database Cacti default character set utf8;
mysql>GRANT SELECT, INSERT, UPDATE, DELETE, INDEX, ALTER, CREATE, LOCK TABLES, CREATE TEMPORARY TABLES, DROP, REFERENCES ON Cacti.* TO cactiuser @localhost IDENTIFIED BY ‘ cactiuser ’;
mysql>flush privileges;
mysql> exit;