CentOS 5.7下Cacti 0.8.7i安装(3)

5.  mysql已经安装好。直接安装cacti
5.1  wget
     tar zvxf cacti-0.8.7i.tar.gz
5.2  mv cacti-0.8.7i  /usr/local/apache/htdocs/cacti
5.3  cd /usr/local/apache/htdocs/cacti
5.4  groupadd cactiuser
5.5  useradd cactiuser
5.6  passwd cactiuser
5.6  /usr/local/mysql/bin/mysql -uroot -p123456登录mysql命令行,执行以下命令
    source /usr/local/apache/htdocs/cacti/cacti.sql;
    create database cacti;
    GRANT ALL PRIVILEGES ON cacti.* TO cactiuser@localhost IDENTIFIED BY "cactipassword";
    flush privileges;
5.7  修改cacti配置文件,vi include/config.php
    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "cactipassword";
    $database_port = "3306";
    $database_ssl = false;    
5.8  修改rra和log文件夹权限,chown cactiuser:cactiuser rra/* log/*
5.9  修改计划任务,使CACTI每5分钟获得一次数据
    su cactiuser
    crontab -e
    */5 * * * * /usr/local/php/bin/php /usr/local/apache/htdocs/cacti/poller.php > /dev/null 2>&1
   
失败原因排查:
1.检查/usr/local/apache/htdocs/cacti主目录下rra/,有没有数据,如果没有检查rra/ log/的拥有者是不是cactiuser
2.执行 snmpwalk -v 2c -c public 127.0.0.1(serverIP) if    用来测试被控对象()是否开启了SNMP服务,如果不是编译安装snmp可能找不到snmpwalk命令
3.执行 snmpwalk -v 2c 127.0.0.1(serverIP) -c public .1.3.6.1.4.1.2021.10.1.3   查看被控端是否有CPU负载的数据返回
4.执行 su cactiuser; /usr/local/php/bin/php /usr/local/apache/htdocs/cacti/poller.php  测试PHP是否可以采集到数据
5.如果可以进去cacti管理页面,但是还是无数据,Console->Configuration->Settings->Paths 检查各项path是否配置ok

CentOS 5.7下Cacti 0.8.7i安装

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/0af4dec8db3be55a2473b890a1b1010b.html