Cacti安装配置

Cacti介绍

Cacti是用php语言实现的一个软件,它的主要功能是用snmp服务获取数据,然后用rrdtool储存和更新数据,当用户需要查看数据的时候用rrdtool生成图表呈现给用户。因此,snmp和rrdtool是cacti的关键。

Snmp关系着数据的收集,rrdtool关系着数据存储和图表的生成。snmp抓到数据不是存储在mysql中,而是存在rrdtool生成的rrd文件中(在cacti根目录的rra文件夹下,一般以rra为后缀名称)。

安装rrdtool采集工具

shell > yum install cairo-devel libxml2-devel pango pango-devel libart_lgpl libart_lgpl-deve
shell > tar xzf rrdtool-1.4.5.tar.gz
shell > cd rrdtool-1.4.5
shell > ./configure --prefix=/usr/local/rrdtool --disable-python --disable-tcl
shell > make && make install
shell > ln -s /usr/local/rrdtool/bin/* /usr/local/bin/

安装SNMP服务

shell > yum install net-snmp  net-snmp-utils 

shell > vim /etc/snmp/snmpd.conf
================================================================================
com2sec notConfigUser  127.0.0.1       public
access  notConfigGroup ""      any       noauth    exact  all none none
view all    included  .1                               80
================================================================================
shell > chkconfig snmpd on
shell > service snmpd start

安装cacti

shell > tar zxvf cacti-0.8.8c.tar.gz
shell > mv cacti-0.8.8c /usr/local/apache2/htdocs/cacti

创建cacti数据库并导入数据
mysql> CREATE DATABASE cacti DEFAULT CHARACTER SET utf8;
mysql> grant all on cacti.* to cacti@'localhost' identified by "123@qwe";
mysql> flush privileges;

shell > mysql -u cacti -p123@qwe cacti < /usr/local/apache2/htdocs/cacti/cacti.sql
shell > chmod -R  777 /usr/local/apache2/htdocs/cacti/rra
shell > chmod -R  777 /usr/local/apache2/htdocs/cacti/log

修改/usr/local/apache2/htdocs/cacti/include/config.php数据库配置

安装spine

spine是一个基于C语言的,非常快速的轮询引擎。它是默认的cmd.php的可选替代,主要是为了加快SNMP轮训。

shell > yum install net-snmp-devel mysql-devel
shell > tar zxvf cacti-spine-0.8.8c.tar.gz
shell > cd cacti-spine-0.8.8c
shell > ./configure --prefix=/usr/local/spine
shell > make && make install
shell > cp /usr/local/spine/etc/spine.conf.dist /usr/local/spine/etc/spine.conf
修改/usr/local/spine/etc/spine.conf数据库配置

添加Rrdtool抓图任务计划

shell > crontab -l
*/5  * * * * /usr/bin/php /usr/local/apache2/htdocs/cacti/poller.php > /dev/null 2>&1
shell > service crond restart

Cacti安装完毕,测试访问

  1. 访问http:///cacti --> next
  2. new install --> next
  3. 修改安装路径 --> finish
  4. 登录默认用户密码admin/admin, 修改保存密码

参考:
http://os.51cto.com/art/201411/458006_all.htm
https://blog.linuxeye.com/314.html
http://blog.chinaunix.net/uid-17015055-id-3071761.html

整理自网络

Svoid
2015-07-08

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29733787/viewspace-1735713/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/29733787/viewspace-1735713/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Cacti是一个基于Web的网络图形解决方案,用于监控和图形化显示网络设备和服务器的性能。以下是Cacti 1.2.24的安装步骤: 1. 确保系统已满足Cacti的要求。Cacti需要一个运行Apache、PHP、MySQL的服务器环境。 2. 下载Cacti安装包。你可以从Cacti的官方网站上下载最新的稳定版本。 3. 解压缩安装包。将安装包解压到服务器的web目录下(比如/var/www/html/)。 4. 创建一个MySQL数据库用于存储Cacti的数据。你可以使用MySQL的命令行工具或者图形界面工具创建一个新的数据库,并为其指定一个用户和密码。 5. 导入Cacti的数据库模板。在安装包的docs目录下可以找到一个名为cacti.sql的SQL模板文件。将该文件导入到你所创建的Cacti数据库中。 6. 配置Cacti。在安装包的include目录下可以找到一个名为config.php.default的配置文件。将该文件复制为config.php,并根据你的数据库信息进行相应的配置。 7. 设置访问权限。确保Web服务器能够访问Cacti安装目录及其相关文件。 8. 启用Cacti的轮询服务。在Cacti安装目录下执行命令`php poller.php`来启动Cacti的轮询服务。 9. 访问Cacti的Web界面。使用你配置Cacti管理员帐户登陆到Cacti的Web界面,即可开始配置和监控你的网络设备和服务器。 以上是Cacti 1.2.24的基本安装步骤,根据你的系统环境和需求可能会有一些小的差异。如果遇到问题,你可以参考Cacti的官方文档或寻求相关帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值