• CentOS 6.6 安装Cacti


    1、最小化安装CentOS6.6,装好系统以后关闭防火墙和selinux
    [root@Cacti ~]#chkconfig iptables off
    [root@Cacti ~]#vi /etc/sysconfig/selinux   //把SELINUX=enforcing改为SELINUX=disabled
    [root@Cacti ~]#reboot    //重启一下系统

    2、安装Cacti依赖的软件
    [root@Cacti ~]#yum -y install mysql mysql-server mysql-devel httpd php php-pdo php-snmp php-mysql lm_sensors net-snmp net-snmp-utils net-snmp-libs rdtool rrdtool-devel perl-PlRPC perl-DBI perl-rrdtool perl-DBD-MySQL wget

    3、装好依赖软件之后,snmp有3个地方需要配置一下
    [root@Cacti ~]#vi /etc/snmp/snmpd.conf
    第41行:将 com2sec notConfigUser default public 中的 "default" 改为 "127.0.0.1"
    第62行:将 access notConfigGroup "" any noauth exact systemview none none 中的 "systemview" 改为 "all"
    第85行:将 #view all include .1 80 这一行前面的 # 号去掉

    4、httpd有一个地方需要配置
    [root@Cacti ~]#vi /etc/httpd/conf/httpd.conf
    第276行 找到#ServerName www.example.com:80
    把#号注释拿掉,将 www.example.com:80 改为 localhost:80

    5、启动3个重要的服务
    [root@Cacti ~]#service snmpd start
    [root@Cacti ~]#chkconfig snmpd on
    [root@Cacti ~]#service httpd start
    [root@Cacti ~]#chkconfig httpd on
    [root@Cacti ~]#service mysqld start
    [root@Cacti ~]#chkconfig mysqld on

    6、安装并配置cacti
    [root@Cacti ~]#wget http://www.cacti.net/downloads/cacti-0.8.8d.tar.gz
    [root@Cacti ~]#tar zxvf cacti-0.8.8d.tar.gz
    [root@Cacti ~]#mv cacti-0.8.8d /var/www/html/cacti

    7、设置mysql数据库
    [root@Cacti ~]#mysql -uroot -p     //新装的mysql没有密码,直接回车进入mysql数据库
    mysql>create database cacti;   //首先创建cacti数据库,注意别丢了分号
    mysql>grant all privileges on cacti.* to cacti@localhost identified by 'cacti' with grant option;    //创建cacti用户并授权
    mysql>flush privileges;
    mysql>use cacti;
    mysql>source /var/www/html/cacti/cacti.sql;    //导入cacti数据库文件
    mysql>exit

    8、配置cacti
    [root@Cacti ~]#vi /var/www/html/cacti/include/config.php
    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cacti";
    $database_password = "cacti";
    $database_port = "3306";

    9、增加 cacti 用户以用来写入rrd和log目录的数据,否则就会生成不了图片
    [root@Cacti ~]#useradd cacti
    [root@Cacti ~]#cd /var/www/html/cacti
    [root@Cacti ~]#chown -R cacti rra/ log/

    10、添加任务计划
    具体多长时间让cacti生成一次监控图表自己决定,这里以cacti的默认时间5分钟生成一次为例
    [root@Cacti ~]#crontab -e
    加入这一行保存即可
    */5 * * * * php /var/www/html/cacti/poller.php > /dev/null 2>&1

    11、配置好之后重启输入 http://ip/cacti,如下图所示

     

    安装成功!

  • 相关阅读:
    c#剪切板操作
    eclipse mvn build error tips
    Redis Tips
    IntilliJ Idea 使用中的问题与解决方案
    mongo
    python
    SQL Relative
    sybase update
    run current vim file
    git
  • 原文地址:https://www.cnblogs.com/kgdxpr/p/4633108.html
Copyright © 2020-2023  润新知