下载cacti到/tmp
下载rrdtool zlib
下载net-snmp
下载 libxml2
一.创建cacti用户
# mkdir /export/home
# groupadd -g 106 cacti
# useradd -u 106 -s /usr/bin/bash -g cacti -d /export/home/cacti -m cacti
# passwd cacti
二.修改环境变量PATH和LD_LIBRARY_PATH
vi /etc/profile
export PATH=$PATH:/usr/ccs/bin:/usr/sfw/bin:/usr/local/httpd/bin:/usr/bin:
/usr/local/rrdtool-1.0.49/bin:usr/local/bin:/usr/openwin/bin:/usr/lo
cal/mysql/bin:/usr/local/php/bin:/usr/local/sbin:/usr/openv/netbackup/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/ssl/lib:/lib:
/usr/local/apr/lib:/usr/openwin/lib:/usr/lib:/usr/local/mysql/lib/mysql:
/usr/local/lib:/usr/local/mysql/lib/mysql/lib:/usr/local/lib/sparcv9/:/usr/ccs/lib/
三.安装依赖软件
1.安装freetype
#gunzip -c freetype-2.3.0.tar.gz |tar xvf -
#cd freetype-2.3.0
#make
#make install
2.安装rrdrool
# gunzip rrdtool-1.0.49-sol9-sparc-local.gz
# pkgadd -d rrdtool-1.0.49-sol9-sparc-local
# ln -s /usr/local/rrdtool-1.0.49/bin/rrdtool /usr/local/bin/rrdtool
3.安装zlib
# gunzip zlib-1.2.3-sol9-sparc-local.gz
# pkgadd -d zlib-1.2.3-sol9-sparc-local
4.安装libxml2
#gunzip -c libxml2-2.4.23 |tar xvf -
#make
#make install
5.安装net-snmp
# cd /etc/rc3.d
# ./S76snmpdx stop
# ./S77dmi stop
# mv S76snmpdx _S76snmpdx
# mv S77dmi _S77dmi
#gunzip -c net-snmp-5.3.1.tar.gz |tar xvf -
#cd net-snmp-5.3.1
#./configure
#make
#make install
#/opt/net-snmp/sbin/snmpd -c /opt/net-snmp/bin/snmpd.conf
四.安装配置cacti
#cd /usr/local/httpd/htdocs/
#gunzip -c cacti-0.8.6j.tar.gz |tar xvf -
#mv cacti-0.8.6j cacti
#cd cacti
#chown -R cacti:cacti rra/ log/
创建cacti数据库
#mysql -u root -p
mysql> create database cacti;
mysql> use cacti;
mysql> source /tmp/cacti-0.8.6j/cacti.sql;
mysql> grant all on cacti.* to identified by 'root123'; 创建帐号
mysql> flush privileges;
修改配置文件config.php
#vi include/config.php
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "admin";
$database_password = "cacti";
编辑httpd.conf加入cacti目录
AllowOverride AuthConfig
五.安装测试:
#apachectl start
在浏览器上输入:
进入cacti的初始设置页面:
点击 install ---->> next --->>
确认一些信息,如rrdtool、php、snmpwalk、snmpget的位置,使用ucd-snmp还是net-snmp等;
只有全部为[FOUND]才能进行下一步;
输入原始的用户和密码:admin/admin
更改admin用户的密码,
点击 Save 安装完成!
现在可以在浏览器中进入Cacti了
六.写入计划任务
#crontab -e
* * * * * cacti php /usr/local/httpd/htdocs/cacti/poller.php > /dev/null 2>&1
阅读(1644) | 评论(0) | 转发(0) |