设为首页 收藏本站
查看: 1197|回复: 0

[经验分享] CentOS CACTI,RRDTool安装

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-11-22 13:32:05 | 显示全部楼层 |阅读模式
  安装环境:CentOs4.4
依次安装apache,mysql,php,cacti ,rrdtool

1.安装apache
Quotation# tar  xzvf  http-2.2.8.tar.gz
# cd  http-2.2.8
./configure --prefix=/usr/local/apache2 --enable-so --enable-deflate --enable-cache --enable-disk-cache --enable-mem-cache --enable-file-cache --enable-modules=all --enable-shared=max --enable-rewrite --enable-static-support --enable-static-htpasswd --enable-static-htdigest --enable-static-rotatelogs --enable-static-logresolve --enable-static-htdbm --enable-static-ab --enable-static-checkgid --enable-vhost-alias --disable-userdir --with-mpm=worker
# make
# make install
# /usr/local/apache2/bin/apachectl start
# cd /etc/rc3.d
# ln -s /etc/init.d/httpd S85httpd
# ln -s /etc/init.d/httpd K85httpd  

2.安装Mysql
Quotation#cp mysql-5.1.22-rc-linux-i686-icc-glibc23.tar.gz /usr/local/
#cd /usr/local/
#tar -zxvf mysql-5.1.22-rc-linux-i686-icc-glibc23.tar.gz
#ln -s mysql-5.1.22-rc-linux-i686-icc-glibc23 mysql
#cd mysql
#groupadd mysql
#useradd -g mysql mysql
#chown -R mysql .
#chgrp -R mysql .
#scripts/mysql_install_db --user=mysql
#chown -R root .
#chown -R mysql data
#bin/mysqld_safe --user=mysql &
#support-files/my-large.cnf /etc/my.cnf
#cp support-files/mysql.server /etc/rc.d/init.d/mysqld
#servie mysqld restart
#chkconfig --add mysqld
#chkconfig --level 345 mysqld on
#service mysqld restart  

3.安装基本库
   (1)libxml
Quotation# tar xjvf libxml2-2.6.24.tar.bz2
# cd libxml2-2.6.24
# ./configure --prefix=/usr/local/libxml2
# make
# make install  

(2)jpeg6
Quotation# mkdir /usr/local/jpeg6
# mkdir /usr/local/jpeg6/bin
# mkdir /usr/local/jpeg6/lib
# mkdir /usr/local/jpeg6/include
# mkdir /usr/local/jpeg6/man
# mkdir /usr/local/jpeg6/man/man1
# tar vzxf jpegsrc.v6b.tar.gz
# cd jpeg-6b
# ./configure --prefix=/usr/local/jpeg6 --enable-shared --enable-static
# make
# make install  


(3)freetype
Quotation# cd /usr/local/src
# tar zvxf freetype-2.3.2.tar.gz
# cd freetype-2.3.2
# ./configure --prefix=/usr/local/freetype
# make
# make install  

(4)zlib
Quotation# tar zvxf zlib-1.2.3.tar.gz
# cd zlib-1.2.3
# ./configure --prefix=/usr/local/zlib
# make
# make install  

(5) libpng
Quotation# tar zjvf libpng-1.2.16.tar.bz2
# cd libpng-1.2.16
# cp scripts/makefile.std makefile
# make
# make install  

(6)fontconfig
Quotation#tar -zxvf fontconfig-2.4.2.tar.gz
#cd fontconfig-2.4.2
#./configure
#make
#make install  

(7)gd
Quotation# tar xzvf gd-2.0.34.tar.gz
# cd gd-2.0.34
# ./configure --prefix=/usr/local/gd2 --with-png=/usr/local/lib --with-zlib=/usr/local/zlib --with-freetype=/usr/local/freetype --with-jpeg=/usr/local/jpeg6 --with-libxml=/usr/local/libxml2
# make
# make install  

4.载入共享库
编辑/etc/ld.so.conf
增加以下内容
Quotation/usr/local/zlib/lib
/usr/local/freetype/lib
/usr/local/jpeg6/lib
/usr/local/gd2/lib  执行ldconfig,装入以上共享库


5.安装Php
Quotation#tar -zxvf php-5.2.6.tar.gz
#cd php-5.2.6
#./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-gd=/usr/local/gd2 --with-freetype-dir=/usr/local/freetype --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir=/usr --with-zlib-dir=/usr/local/zlib --enable-gd-native-ttf --with-ttf --enable-gd-jis-conv--enable-xml --enable-mbstring --enable-sockets --enable-soap  
  如果MYSQL是GZ安装:
  ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql-dir=/user/local/mysql --with-gd=/usr/local/gd2 --with-ttf --with-freetype-dir=/usr/local/freetype2 --with-jpeg-dir=/usr/local/jpeg6 --with-png-dir=/usr/local/libpng2 --with-libxml-dir=/usr/local/libxml2 --with-zlib-dir=/usr/local/zlib --with-curl=/usr/local/crul --enable-gd-native-ttf --enable-gd-jis-conv --enable-xml --enable-mbstring --enable-sockets

6.让apache支持php
# vi /usr/local/apache2/conf/httpd.conf
找到AddType application/x-gzip .gz .tgz
添加
QuotationAddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps  



找到DirectoryIndex index.html
修改成
QuotationDirectoryIndex index.html index.php  


7.安装 rrdtool
Quotation#tar -zxvf rrdtool.tar.gz
#cd rrdtool-1.2.23
#./configure --prefix=/usr/local/rrdtool --disable-python --disable-tcl
# make
# make install  

8.安装net-snmp
Quotation#yum -y install net-snmp-*  或者源码编译
Quotation#tar zxvf net-snmp-5.2.4.tar.gz
#cd net-snmp-5.2.4
#./configure --prefix=/usr/local/net-snmp  --enable-developer
#make
#make install  

9.安装Cacti
Quotation#tar -zxvf cacti-0.8.7b.tar.gz
#cd cacti-0.8.7b
#mv cacti-0.8.7b /usr/local/apache2/htdocs/cacti
#cd /usr/local/apache2/htdocs/cacti/  
#vi include/config.php

Quotation$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "cactipw";  

Quotation#/usr/local/mysql/bin/mysql -uroot -p cactidb < cacti.sql
#useradd cactiuser
#chown -R cactiuser rra
#chgrp -R cactiuser /usr/local/apache/htdocs/cacti/
#crontab -ucactiuser -e  
*/5 * * * * /usr/local/php/bin/php /usr/local/apache2/htdocs/cacti/poller.php > /dev/null 2>&1


10.安装cactid
Quotation#tar -zxvf cacti-cactid-0.8.6g.tar.gz
#cd cacti-cactid-0.8.6g
#./configure --with-mysql=/usr/local/mysql
#make
#make install
#mkdir /usr/local/cactid/
#cp cactid cactid.conf /usr/local/cactid/  
# vi  /usr/local/cactid/cactid.conf   
QuotationDB_Host         127.0.0.1
DB_Database     cactidb
DB_User         cactiuser
DB_Pass         cactipw  

11.数据库配置
Quotationmysql> create database cactidb;
Query OK, 1 row affected (0.00 sec)  
Quotation
mysql> grant all on cactidb.* to cactiuser@localhost identified by “cactipw”;
Query OK, 1 row affected (0.00 sec)  


12.完成cacti的安装
输入:http://IP/cacti/
admin/admin
修改密码
更具具体安装路径设置
snmpwalk Binary Path
RRDTool Binary Path等等路径
进入cacti,根据现有模版监控服务器对象



cacti以及rrdtool博大精深,更多信息
请请参阅官方文档
http://www.cacti.net
http://www.rrdtool.org

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-142164-1-1.html 上篇帖子: Cacti升级迁移实录 下篇帖子: CentOS/RHEL上通过Cacti监控mysql
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表