我们如果用yum不可以安装cacti,我们则可以利用tar包来安装!!!
//cacti的配置准备 [[email protected] ~]# yum install -y epel-release [[email protected] ~]# yum install -y httpd php php-mysql mysql mysql-server mysql-devel php-gd libjpeg libjpeg-devel libpng libpng-devel a [[email protected] ~]# yum install -y net-snmp net-snmp-utils rrdtool [[email protected] ~]# /etc/init.d/mysqld start [[email protected] ~]# /etc/init.d/httpd start [[email protected] ~]# /etc/init.d/snmpd start //安装cacti并配置 [[email protected] ~]# cd /usr/local/src [[email protected] src]# wget http://www.cacti.net/downloads/cacti-0.8.7e.tar.gz [[email protected] src]# tar -zxvf cacti-0.8.7e.tar.gz [[email protected] src]# mv cacti-0.87e /var/www/html/cacti //创建cacti数据库 [[email protected] src]# mysql -uroot ... ... mysql>create database cacti; mysql>grant all on cacti.* to ‘cacti‘@‘localhost‘ identified by ‘cacti’; mysql>flush privileges; mysql> exit Bye //导入cacti.sql [[email protected] src]# mysql -u root cacti < /var/www/html/cacti/cacti.sql //修改配置文件 [[email protected] src]# cd /var/www/html [[email protected] html]# vim cacti/include/config.php //change $database_type = “mysql”; $database_default = “cacti”; $database_name = "cacti" ; $database_hostname = “127.0.0.1" ; $database_username = “cacti”; $database_password = “cacti”; $database_port = “3306″; //更改属组 [[email protected] html]# useradd cacti [[email protected] html]# chgrp -R cacti /var/www/html/cacti [[email protected] html]# chown -R cacti /var/www/html/cacti/rra [[email protected] html]# chown -R cacti /var/www/html/cacti/log [[email protected] html]# chown -R cacti /var/www/html/cacti/poller.php //web安装cacti http://ip/cacti (这里如果出现“403 forbidden”的错误,请把selinux关闭) 点两下“next” 和一次”Finish“ 即可 输入admin admin 登录,重新设置新的密码
//使cacti生成图表 [[email protected] html]# /usr/bin/php /var/www/html/cacti/poller.php [[email protected] html]# crontab -e //ADD */5 * * * * /usr/bin/php /var/www/html/cacti/poller.php //剩下步骤与之前的cacti配置一致 ,可前往查看
时间: 2024-10-15 03:45:10