[小芮]网络流量监测图形分析工具 cacti0.8.7 安装脚本

centos5.5是ok了,6的话,脚本运行报错,可以一步步的贴命令

  
  
  
  
  1. #!/bin/bash
  2. #by rfyiamcool 
  3. read -p "mysql的密码" mima  
  4. setenforce 0  
  5. sed -i 's/enforcing/disabled/g' /etc/sysconfig/selinux  
  6. iptables -F  
  7. if cat /etc/issue|grep 6 ;then  
  8.         rpm -ivh http://mirrors.sohu.com/fedora-epel/6/i386/epel-release-6-7.noarch.rpm  
  9.     else  
  10.         rpm -ivh http://mirrors.sohu.com/fedora-epel/5/i386/epel-release-5-4.noarch.rpm  
  11.     fi  
  12. yum install -y httpd mysql mysql-server php php-mysql net-snmp net-snmp-utils  
  13. yum install -y zlib libpng freetype libjpeg fontconfig gd libxml2  
  14. yum install -y rrdtool patch  
  15. service mysqld start  
  16. /usr/bin/mysqladmin --user=root create cacti  
  17. mysql -e "GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY '$mima'"  
  18. cd /var/www/html/  
  19. wget http://www.cacti.net/downloads/cacti-0.8.7g.tar.gz  
  20. tar xf cacti-0.8.7g.tar.gz  
  21. rm -rf cacti-0.8.7g.tar.gz  
  22. cd cacti-0.8.7g/  
  23. mv * ../  
  24. cd ..  
  25. rm -rf cacti-0.8.7g/  
  26. mysql -ucactiuser -p$mima cacti < /var/www/html/cacti.sql  
  27. sed -i "30s/cactiuser/$mima/" /var/www/html/include/config.php  
  28. echo '*/5 * * * * root /usr/bin/php /var/www/html/poller.php' >> /etc/crontab  
  29. chkconfig snmpd on  
  30. chkconfig httpd on  
  31. chkconfig mysqld on  
  32. chkconfig crond on  
  33. service httpd restart  
  34. service snmpd restart  
  35. service mysqld restart  
  36. service crond restart  
  37. wget http://mirror.cactiusers.org/downloads/plugins/cacti-plugin-0.8.7g-PA-v2.8.tar.gz  
  38. tar zxvf cacti-plugin-0.8.7g-PA-v2.8.tar.gz  
  39. cp -rf cacti-plugin-arch/* /var/www/html/  
  40. cd /var/www/html/  
  41. mysql -ucactiuser -p$mima cacti < /var/www/html/pa.sql  
  42. patch -p1 -N <cacti-plugin-0.8.7g-PA-v2.8.diff  

 

你可能感兴趣的:(网络流量,cacti安装脚本,cacti0.8.7)