一.安装rrdtool
yum -y install rrdtool
二.安装配置net-snmp
1.安装net-snmp
yum -y install net-snmp net-snmp-libs net-snmp-utils
2.配置net-snmp
vim /etc/snmp/snmpd.conf
view systemview included .1.3.6.1.2.1.1
改为
view systemview included .1.3.6.1.2.1
3.测试net-snmp
service snmpd start
snmpwalk -v 1 -c public localhost .1.3.6.1.2.1.1.1.0
SNMPv2-MIB::sysDescr.0 = STRING: Linux test 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64
三.安装LAMP
yum -y install httpd php php-mysql php-snmp php-xml php-gd mysql mysql-server
service httpd start
service mysqld start
mysqladmin -uroot password 123
mysqladmin --user=root --password reload
Enter password:
1.下载cacti
wget http://www.cacti.net/downloads/cacti-0.8.8b.tar.gz
tar zxfv cacti-0.8.8b.tar.gz
mv cacti-0.8.8b /var/www/html/cacti
cd /var/www/html/cacti/
2.创建数据库
mysqladmin --user=root -p create cacti
3.导入数据库
mysql -uroot -p cacti < cacti.sql
4.创建数据库用户
mysql -u root -p mysql
mysql> GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY '123';
mysql> flush privileges;
5.配置include/config.php
vim include/config.php
$database_type = "mysql";
$database_default = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "123";
$database_port = "3306";
$database_ssl = false;
/* load up old style plugins here */ #enable plugins
$plugins = array();
//$plugins[] = 'thold';
/*
Edit this to point to the default URL of your Cacti install
ex: if your cacti install as at http://serverip/cacti/ this
would be set to /cacti/
*/
//$url_path = "/cacti/";
/* Default session name - Session name must contain alpha characters */
//$cacti_session_name = "Cacti";
?>
6.设置目录权限
useradd cactiuser
chown -R cactiuser rra/ log/
7.配置计划任务
echo "*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1">>/etc/crontab
service crond restart
Stopping crond: [ OK ]
Starting crond: [ OK ]
8.设置开机启动服务
chkconfig --level 35 snmpd on
chkconfig --level 35 httpd on
chkconfig --level 35 mysqld on
chkconfig --level 35 crond on
9.SELINUX和IPTABLES设置
iptables -A INPUT -i eth0 -p tcp --dport 80 -j ACCEPT
restorecon -Rv ../cacti/
9.完成cacti安装
1)在浏览器中输入:http://www.yourdomain.com/cacti
默认用户名:admin 密码:admin
2)更改密码
3)安装指南
4)提示这个直接next
5)new install 然后next
6)直接点完成
7)登陆界面,登陆之后会提示你重置下密码
8)安装完成