一、搭建lamp架构
1、yum方式如下:
yum groupinstall “Web Server”
group notConfigGroup v1 notConfigUser
group notConfigGroup v2c notConfigUser
view systemview included .1.3.6.1.2.1.1
view systemview included .1.3.6.1.2.1.25.1.1
access notConfigGroup "" any noauth exact all none none
view all included .1 80
syslocation Unknown (edit /etc/snmp/snmpd.conf)
syscontact Root <root@localhost> (configure /etc/snmp/snmp.local.conf)
pass .1.3.6.1.4.1.4413.4.1 /usr/bin/ucd5820stat
smuxpeer .1.3.6.1.4.1.674.10892.1
$database_type= “ mysql ” ; #数据库类型
$database_default ="cacti"; #数据库名称
$database_hostname = "localhost"; #默认是 localhost
$database_username = "cactiuser"; #数据库用户名
$database_password = "cactiuser"; #密码 |
*/5 * * * * /data/php/bin/php /data/www/cacti/poller.php > /dev/null 2>&1
(其中 /data/php/bin/php 这个为 php 的安装目录)
之后wq保存退出
|
mysql> flush privileges; ( #刷新权限)
export INSTALL_DIR=/usr/local/rrdtool
mkdir -p $BUILD_DIR
cd $BUILD_DIR
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.5.tar.gz
gunzip -c rrdtool-1.4.5.tar.gz | tar xf -
cd rrdtool-1.4.5
./configure --prefix=$INSTALL_DIR && make && make install
export MAKE=make
export PATH=$INSTALL_DIR/bin:$PATH
export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
cd $BUILD_DIR
gunzip -c pkg-config-0.23.tar.gz | tar xf -
cd pkg-config-0.23
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
gunzip -c zlib-1.2.3.tar.gz | tar xf -
cd zlib-1.2.3
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
gunzip -c libpng-1.2.18.tar.gz | tar xf -
cd libpng-1.2.18
env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
gunzip -c freetype-2.3.5.tar.gz | tar xf -
cd freetype-2.3.5
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
gunzip -c libxml2-2.6.32.tar.gz | tar xf -
cd libxml2-2.6.32
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
gunzip -c fontconfig-2.4.2.tar.gz | tar xf -
cd fontconfig-2.4.2
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --with-freetype-config=$INSTALL_DIR/bin/freetype-config
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
gunzip -c pixman-0.10.0.tar.gz | tar xf -
cd pixman-0.10.0
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
gunzip -c cairo-1.6.4.tar.gz | tar xf -
cd cairo-1.6.4
./configure --prefix=$INSTALL_DIR --enable-xlib=no --enable-xlib-render=no -enable-win32=no CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
gunzip -c glib-2.15.4.tar.gz | tar xf -
cd glib-2.15.4
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
$MAKE
$MAKE install
wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
bunzip2 -c pango-1.21.1.tar.bz2 | tar xf -
cd pango-1.21.1
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x
$MAKE
$MAKE install
cd $BUILD_DIR/rrdtool-1.4.5
./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
$MAKE clean
$MAKE
$MAKE install
DB_Database cacti #所连接的库
DB_User cactiuser #数据库用户
DB_Pass cactiuser #数据库密码
DB_Port 3306 #连接数据库端口
第一次默认登陆账号:admin 密码 admin
登陆后它就会让你立即修改新密码
cd cacti-plugin-arch/
cp cacti-plugin-0.8.7g-PA-v2.8.diff /data/www/cacti/
cp pa.sql /data/www/cacti/
cd /data/www/cacti
patch -p1 -N < cacti-plugin-0.8.7g-PA-v2.8.diff (这个必须是在cacti目录下执行)
mysql –uroot –p cacti < pa.sql
本文出自 “技术成就梦想” 博客,请务必保留此出处http://52199999.blog.51cto.com/740826/486647