mysql-5.0.77-3.el5、mysql-connector-odbc-3.51.26r1127-1.el5、mysql-server-5.0.77-3.el5
php-common-5.1.6-23.2.el5_3、php-pdo-5.1.6-23.2.el5_3、php-5.1.6-23.2.el5_3
php-mysql-5.1.6-23.2.el5_3
2.使用rpm-qa |grep gd、rpm -qa |grep zlib命令查看软件包是否安装,如未安装就挂载RHEL5光盘进行安装。
[root@linux5234 ~]#rpm -ivh net-snmp
[root@linux5234 ~]#rpm -ivh net-snmp-utils
[root@linux5234 ~]#cd rrdtool-1.2.27
[root@linux5234 ~]#.configure --prefix=/usr/local
[root@linux5234 ~]#make && make install
中文软件包)
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@linux5234 ~]# cd /media/6/
[root@linux5234 6]# cd /var/www/html/
[root@linux5234 html]# tar zxf /media/6/cacti-0.8.7b-cn-utf8.tar.gz
[root@linux5234 html]# mv cacti-0.8.7b-cn-utf8 cacti
[root@linux5234 html]# useradd cacti
[root@linux5234 html]# chown -R cacti.cacti cacti/rra/ cacti/log/
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.0.77 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database cactidb default character set utf8; //创建数据库并设置默认字符集
Query OK, 1 row affected (0.00 sec)
mysql> grant all on cactidb.* to cacti@localhost identified by 'pwd@123';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@linux5234 html]# mysql -u cacti -p cactidb < cacti/cacti.sql //导入数据表
Enter password: //输入密码后导入成功
[root@linux5234 cacti]# vi include/config.php //需要修改的内容如下
$database_type = "mysql";
$database_default = "cactidb"; //要访问的数据库名
$database_hostname = "localhost"; //数据库服务器的地址
$database_username = "cacti"; //授权访问数据库的用户
$database_password = pwd@123; //授权密码
$database_port = "3306"; //mysql数据库服务的端口
$config['url_path'] = "/"; //指定Cacti目录相对于网站根目录的位置
DocumentRoot "/var/www/html/cacti" //设置网站文件根目录
<Directory "/var/www/html/cacti"> //设置目录权限
Options None
AllowOverride None
Order allow,deny
Allow from all
</Directory>
DirectoryIndex index.php index.html //设置默认的索引页
AddDefaultCharset UTF-8 //设置网页默认的字符集
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost ~]# cd /media/Server/
[root@localhost Server]# rpm -ivh lm_sensors-2.10.7-4.el5.i386.rpm
[root@localhost Server]# rpm -ivh net-snmp-5.3.2.2-7.el5.i386.rpm
com2sec notConfigUser 192.168.0.66 public //192.168.0.66为Cacti监测服务器的IP地址
62行
access notConfigGroup "" any noauth exact all none none //将SystemViem 修改为all或read,提供访问权限
85行
view all included .1 80 //去掉此行前面的#号
[root@localhost ~]# chkconfig --level 35 snmpd on
[cacti@linux5234 ~]$ php /var/www/html/cacti/poller.php //执行首次初化必须使用cacti用户,出现以下数据,表示初始化成功,可以查看到监控图像,如果没有以下数据,将不会看到正常的监控图像
OK u:0.00 s:0.14 r:2.82
OK u:0.00 s:0.14 r:2.83
OK u:0.00 s:0.14 r:2.83
OK u:0.00 s:0.14 r:2.83
OK u:0.00 s:0.15 r:2.85
OK u:0.00 s:0.15 r:2.85
OK u:0.00 s:0.18 r:2.89
OK u:0.00 s:0.18 r:2.89
OK u:0.00 s:0.18 r:4.85
OK u:0.00 s:0.18 r:4.85
OK u:0.00 s:0.18 r:5.93
OK u:0.00 s:0.18 r:5.93
OK u:0.00 s:0.18 r:5.94
OK u:0.00 s:0.18 r:5.94
OK u:0.00 s:0.18 r:5.99
OK u:0.00 s:0.18 r:5.99
OK u:0.00 s:0.18 r:5.99
OK u:0.00 s:0.18 r:5.99
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:6.00
OK u:0.00 s:0.18 r:7.04
OK u:0.00 s:0.19 r:7.04
OK u:0.00 s:0.19 r:7.04
OK u:0.00 s:0.19 r:7.04
OK u:0.00 s:0.19 r:7.04
OK u:0.00 s:0.19 r:7.05
10/21/2010 11:42:31 AM - SYSTEM STATS: Time:9.2262 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:25 RRDsProcessed:21
OK u:0.00 s:0.19 r:8.11
OK u:0.00 s:0.19 r:8.11
OK u:0.00 s:0.19 r:8.11
OK u:0.00 s:0.19 r:8.11
OK u:0.00 s:0.19 r:8.11
OK u:0.00 s:0.19 r:8.11
OK u:0.00 s:0.19 r:8.11
OK u:0.01 s:0.19 r:8.11
[cacti@linux5234 ~]$ crontab -e //添加计划任务
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php &> /dev/null
[cacti@linux5234 ~]$ exit
[root@linux5234 cacti]# service crond start
[root@linux5234 cacti]# chkconfig --level 35 crond on
本文出自 “.” 博客,请务必保留此出处http://kk5234.blog.51cto.com/1006247/408628