LAMP:环境(yum安装)
yum -y install httpd httpd-manual mysql mysql-server php php-mysql php-common php-pdo php-gd
启动服务
service httpd start
chkconfig httpd on
service mysqld start
chkconfig mysqld on
安装snmp
yum -y install net-snmp*
service snmpd start
安装rrdtool
cd /work/
tar -zxvf rrdtool-1.2.27.tar.gz -C /usr/src/
/usr/src/rrdtool-1.2.27/
./configure --prefix=/usr/local/
make && make install
安装cacti
[root@localhost html]# mv cacti-0.8.7b-cn-utf8/ cacti
[root@localhost html]# dd.html' target='_blank'>useradd cactiuser
[root@localhost html]# chown -R cactiuser:cactiuser cacti/rra cacti/log
连接数据库
[root@localhost html]# mysqladmin -u root password '123456'
[root@localhost html]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 6
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 cactiuser@localhost identified by 'pwd@123';
Query OK, 0 rows affected (0.00 sec)
mysql> quit
Bye
[root@localhost html]# mysql -u cactiuser -p cactidb < cacti/cacti.sql
Enter password:
编辑config.php配置文件
vim /var/www/html/cacti/include/config.php
$database_type = "mysql";
$database_default = "cactidb";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "pwd@123";
$database_port = "3306";
$config['url_path'] = "/";
编辑httpd.conf文件
vim /etc/httpd/conf/httpd.conf
281 DocumentRoot "/var/www/html/cacti"
282 <Directory "/var/www/html/cacti">
283 Options None
284 AllowOverride None
285 Order allow,deny
286 Allow from all
287 </Directory>
396 DirectoryIndex index.php index.html index.html.var
设置计划任务,读取信息
[cactiuser@localhost ~]$ crontab -e
no crontab for cactiuser - using an empty one
*/5 * * * * /usr/bin/php /var/www/html/cacti/poller.php &> /dev/null
service crond start
chkconfig crond on
客户端 yum -y install net-snmp*
vim /etc/snmp/snmpd.com 编辑如下
41 com2sec notConfigUser 192.168.0.20 public //服务器IP
62 access notConfigGroup "" any noauth exact all none none
85 view all included .1 80

设置路径

发现已经有图出来了

完成