Cacti安装配置的详细步骤

目录(?) [+]
  1. 需要的软件
  2. 安装步骤
    1. 安装mysql数据库
    2. 安装apache服务
    3. 安装PHP
    4. 安装rrdtool
    5. 安装net-snmp
    6. 配置MYSQL数据库
    7. 安装 配置cacti

需要的软件:

MySQL、php、apache、rrdtool、snmp、cacti

 

安装步骤:

 

1安装mysql数据库

[sql] view plaincopyprint?

  1. [root@test usr]# groupadd mysql 
  2. [root@test usr]# useradd -g mysql mysql 
  3. [root@test usr]# cd /usr/local 
  4. [root@test local]# tar zxvf mysql-5.1.41.tar.gz 
  5. [root@test local]# mv mysql-5.1.41 mysql 
  6. [root@test mysql]# cd mysql 
  7. [root@test mysql]# ./configure –prefix=/usr/local/mysql 
  8. [root@test mysql]# make && make install 
  9. [root@test mysql]# /usr/local/mysql/bin/mysql_install_db –user=mysql 
  10. [root@test mysql]# chown -R root . 
  11. [root@test mysql]# chown -R mysql data 
  12. [root@test mysql]# chgrp -R mysql . 
  13. [root@test mysql]# ./bin/mysqld_safe –user=mysql & 
  14. [root@test mysql]# /usr/local/mysql/bin/mysqld_safe –user=mysql & 

[root@test usr]# groupadd mysql[root@test usr]# useradd -g mysql mysql[root@test usr]# cd /usr/local[root@test local]# tar zxvf mysql-5.1.41.tar.gz[root@test local]# mv mysql-5.1.41 mysql[root@test mysql]# cd mysql[root@test mysql]# ./configure –prefix=/usr/local/mysql[root@test mysql]# make && make install[root@test mysql]# /usr/local/mysql/bin/mysql_install_db –user=mysql[root@test mysql]# chown -R root .[root@test mysql]# chown -R mysql data[root@test mysql]# chgrp -R mysql .[root@test mysql]# ./bin/mysqld_safe –user=mysql &[root@test mysql]# /usr/local/mysql/bin/mysqld_safe –user=mysql &


 

 

2安装apache服务

[html] view plaincopyprint?

  1. [root@test usr]# tar -zxvf  httpd-2.2.14.tar.gz 
  2. [root@test usr]# cd httpd-2.2.14 
  3. [root@test httpd-2.2.14]# ./configure –prefix=/www –enable-so 
  4. [root@test httpd-2.2.14]# make && make install 
  5. [root@test httpd-2.2.14]# cp /www/bin/apachectl /etc/init.d/httpd 
  6. [root@test httpd-2.2.14]# cd /etc/rc3.d 
  7. [root@test rc3.d]# ln -s /etc/init.d/httpd S85httpd 
  8. [root@test rc3.d]# ln -s /etc/init.d/httpd K85httpd 
  9. [root@test rc3.d]# /www/bin/apachectl start 

[root@test usr]# tar -zxvf httpd-2.2.14.tar.gz[root@test usr]# cd httpd-2.2.14[root@test httpd-2.2.14]# ./configure –prefix=/www –enable-so[root@test httpd-2.2.14]# make && make install[root@test httpd-2.2.14]# cp /www/bin/apachectl /etc/init.d/httpd[root@test httpd-2.2.14]# cd /etc/rc3.d[root@test rc3.d]# ln -s /etc/init.d/httpd S85httpd[root@test rc3.d]# ln -s /etc/init.d/httpd K85httpd[root@test rc3.d]# /www/bin/apachectl start

Apache 安装完毕

 

3安装PHP

[sql] view plaincopyprint?

  1. [root@test usr]# tar -zxvf php-5.2.12.tar.gz 
  2. [root@test usr]# cd php-5.2.12 
  3. [root@test php-5.2.12]# ./configure –prefix=/www/php \ 
  4. > –with-apxs2=/www/bin/apxs \ 
  5. > –with-config-file-path=/www/php \ 
  6. > –enable-sockets \ 
  7. > –with-mysql=/usr/local/mysql \ 
  8. > –with-zlib-dir=/usr/include \ 
  9. > –with-gd 
  10. [root@test php-5.2.12]# make && make install 
  11. [root@test php-5.2.12]# cp php.ini-dist /www/php/php.ini 
  12. [root@test php-5.2.12]# vi /www/conf/httpd.conf 
  13. 按 I 键 添加 AddType application/x-tar .tgz 
  14. AddType application/x-httpd-php .php 
  15. AddType image/x-icon .ico 
  16. DirectoryIndex index.php index.html index.html.var 
  17. 保存退出 :wq 
  18. [root@test php-5.2.12]# /www/bin/apachectl restart 

[root@test usr]# tar -zxvf php-5.2.12.tar.gz[root@test usr]# cd php-5.2.12[root@test php-5.2.12]# ./configure –prefix=/www/php \> –with-apxs2=/www/bin/apxs \> –with-config-file-path=/www/php \> –enable-sockets \> –with-mysql=/usr/local/mysql \> –with-zlib-dir=/usr/include \> –with-gd[root@test php-5.2.12]# make && make install[root@test php-5.2.12]# cp php.ini-dist /www/php/php.ini[root@test php-5.2.12]# vi /www/conf/httpd.conf按 I 键 添加 AddType application/x-tar .tgzAddType application/x-httpd-php .phpAddType image/x-icon .icoDirectoryIndex index.php index.html index.html.var保存退出 :wq[root@test php-5.2.12]# /www/bin/apachectl restart

Php安装完毕

 

4安装rrdtool

[html] view plaincopyprint?

  1. [root@test usr]# tar zxvf rrdtool-1.3.8.tar.gz 
  2. [root@test usr]# cd rrdtool-1.3.8 
  3. [root@test rrdtool-1.3.8]# ./configure 
  4. [root@test rrdtool-1.3.8]# make && make install 

[root@test usr]# tar zxvf rrdtool-1.3.8.tar.gz[root@test usr]# cd rrdtool-1.3.8[root@test rrdtool-1.3.8]# ./configure[root@test rrdtool-1.3.8]# make && make install

Rrdtool安装完毕

 

5安装net-snmp

需要

[sql] view plaincopyprint?

  1. net-snmp-5.0.9-2.30E.15 
  2. net-snmp-devel-5.0.9-2.30E.15 
  3. net-snmp-libs-5.0.9-2.30E.15 
  4. net-snmp-utils-5.0.9-2.30E.15 四个安装包,可以在系统盘中找到相应的RPM包进行安装,也可以用yum install net-snmp*进行安装。 
  5. 安装完成后修改配置文件: 
  6. [root@test usr]# vi /etc/snmp/snmpd.conf 
  7. 更改 1、com2sec notConfigUser  default       public 
  8. 改为:com2sec notConfigUser   127.0.0.1       public 
  9. 2、access  notConfigGroup “”      any       noauth    exact  systemview  none none 
  10. 改为:access  notConfigGroup “”      any       noauth    exact  all  none  none 
  11. 3、#view all    included  .1         80 
  12. 将前面的 # 注释 去掉。 
  13. 保存退出 :wq 
  14. [root@test usr]# service snmpd restart 

net-snmp-5.0.9-2.30E.15net-snmp-devel-5.0.9-2.30E.15net-snmp-libs-5.0.9-2.30E.15net-snmp-utils-5.0.9-2.30E.15 四个安装包,可以在系统盘中找到相应的RPM包进行安装,也可以用yum install net-snmp*进行安装。安装完成后修改配置文件:[root@test usr]# vi /etc/snmp/snmpd.conf更改 1、com2sec notConfigUser default public改为:com2sec notConfigUser 127.0.0.1 public2、access notConfigGroup “” any noauth exact systemview none none改为:access notConfigGroup “” any noauth exact all none none3、#view all included .1 80将前面的 # 注释 去掉。保存退出 :wq[root@test usr]# service snmpd restart


 

 

6配置MYSQL数据库

[sql] view plaincopyprint?

  1. mysql> create database cactidb; 
  2. mysql> grant SUPER,REPLICATION CLIENT,process on *.* to cactiuser@localhost identified by ‘cactipw’; 

mysql> create database cactidb;mysql> grant SUPER,REPLICATION CLIENT,process on *.* to cactiuser@localhost identified by ‘cactipw’;


 

 

7安装/ 配置cacti

[html] view plaincopyprint?

  1. [root@test usr]# useradd cactiuser -g users 
  2. [root@test usr]# passwd cactiuser (pwd:cactipw) 
  3. [root@test usr]# cp cacti-0.8.7b.tar.gz /www/htdocs/ 
  4. [root@test usr]# cd /www/htdocs/ 
  5. [root@test htdocs]# tar zxvf cacti-0.8.7b.tar.gz 
  6. [root@test htdocs]# mv cacti-0.8.7b cacti 
  7. [root@test htdocs]# cd cacti 
  8. [root@test cacti]# /usr/local/mysql/bin/mysql -u root -pmysql cactidb < cacti.sql 
  9. [root@test cacti]# chown -R cactiuser rra/ log/ 
  10. [root@test cacti]# cd scripts 
  11. [root@test scripts]# chown cactiuser:users * 
  12. [root@test scripts]# vi /www/htdocs/cacti/include/config.php 
  13. $database_type = “mysql”; 
  14. $database_default = “cactidb”; 
  15. $database_hostname = “localhost”; 
  16. $database_username = “cactiuser”; 
  17. $database_password = “cactipw”; 
  18. 更改用户、密码 等项 与上面给出的对应 保存退出 
  19. [root@test scripts]# crontab -u cactiuser -e 
  20. 加入 
  21. */5 * * * * /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1 
  22. 保存退出:wq 
  23.  
  24. 全部设置完毕。 
  25. 打开浏览器 http://localhost/cacti 进入cacti的初始设置页面 
  26.  
  27. 第一次默认登陆账号:admin 密码 admin J 
  28.  
  29. 登陆后在新改个密码就OK 
  30.  
  31. 需要说明的还有路径 
  32.  
  33. snmpwalk Binary Path : /usr/bin/snmpwalk 
  34. snmpget Binary Path: /usr/bin/snmpget 
  35. RRDTool Binary Path: /usr/rrdtool-1.3.8/src/rrdtool 
  36. PHP Binary Path: /www/php/bin/php 
  37. Cacti Log File Path: /www/htdocs/cacti/log/cacti.log 
  38. Cactid Poller File Path: /www/htdocs/cacti/poller.php 

[root@test usr]# useradd cactiuser -g users[root@test usr]# passwd cactiuser (pwd:cactipw)[root@test usr]# cp cacti-0.8.7b.tar.gz /www/htdocs/[root@test usr]# cd /www/htdocs/[root@test htdocs]# tar zxvf cacti-0.8.7b.tar.gz[root@test htdocs]# mv cacti-0.8.7b cacti[root@test htdocs]# cd cacti[root@test cacti]# /usr/local/mysql/bin/mysql -u root -pmysql cactidb < cacti.sql[root@test cacti]# chown -R cactiuser rra/ log/[root@test cacti]# cd scripts[root@test scripts]# chown cactiuser:users *[root@test scripts]# vi /www/htdocs/cacti/include/config.php$database_type = “mysql”;$database_default = “cactidb”;$database_hostname = “localhost”;$database_username = “cactiuser”;$database_password = “cactipw”;更改用户、密码 等项 与上面给出的对应 保存退出[root@test scripts]# crontab -u cactiuser -e加入*/5 * * * * /www/php/bin/php /www/htdocs/cacti/poller.php > /dev/null 2>&1保存退出:wq全部设置完毕。打开浏览器 http://localhost/cacti 进入cacti的初始设置页面第一次默认登陆账号:admin 密码 admin J登陆后在新改个密码就OK需要说明的还有路径snmpwalk Binary Path : /usr/bin/snmpwalksnmpget Binary Path: /usr/bin/snmpgetRRDTool Binary Path: /usr/rrdtool-1.3.8/src/rrdtoolPHP Binary Path: /www/php/bin/phpCacti Log File Path: /www/htdocs/cacti/log/cacti.logCactid Poller File Path: /www/htdocs/cacti/poller.php


 

注:此时graphs还不能显示图形,需要将服务重新启动一下

[html] view plaincopyprint?

  1. [root@test scripts]# service snmpd restart 
  2. [root@test scripts]# service mysql restart 
  3. [root@test scripts]# service httpd restart 

[root@test scripts]# service snmpd restart[root@test scripts]# service mysql restart[root@test scripts]# service httpd restart


 

OK,现在打开http://localhost/cacti进入graphs查看localhost就会有图形了。

要添加自定义图形,请阅读《CACTI使用文档》。

 

转自:http://www.zhdba.com/mysqlops/2011/06/08/cacti-install-setting/

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值