设为首页 收藏本站
查看: 1049|回复: 0

[经验分享] 一篇清晰的cacti安装文档,老外写的

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2015-9-7 14:46:25 | 显示全部楼层 |阅读模式
  http://forums.cacti.net/viewtopic.php?f=2&t=46997
  
  Hi all! Finally I'm able to give something back to the community http://forums.cacti.net/images/smilies/icon_smile.gif
Before I begin though, I must admit that I cannot take all of the credit for this "How To". I've only added small bits and pieces to a great "How To" I found on the internet, but can no longer find the original source unfortunately.
Please Note: I am not a Linux nor a Cacti expert, so if there are any unnecessary steps/installations, please let me know so that I can edit this How To accordingly. For example, I don't know if all of the packages listed below are required... I've basically put them together from several guides based on several different versions of Cacti and RRDTool.
Also Note: This is on a clean install which is why packages like gcc and nano are in the package install list.
Anyway, here goes http://forums.cacti.net/images/smilies/icon_smile.gif

***************************************************
Step One:
***************************************************

Install packages for Cacti & RRDTool:


Code:
yum install -y mysql mysql-server httpd mod_ssl php php-snmp php-mysql net-snmp net-snmp-utils nano cairo-devel libxml2-devel pango-devel pango libpng-devel freetype freetype-devel libart_lgpl-devel gcc
yum update  
***************************************************
Step Two:
***************************************************

Download Cacti & move it to your web server directory:


Code:
cd /tmp
wget http://www.cacti.net/downloads/cacti-0.8.8.tar.gz
tar zxvf cacti-0.8.8.tar.gz
mv /tmp/cacti-0.8.8 /var/www/html/cacti  
***************************************************
Step Three:
***************************************************

Reconfigure include/config.php path. Change it from / to /cacti/.
Note: Be sure to uncomment this line too by removing the //, as per the before and after example below.


Code:
nano /var/www/html/cacti/include/config.php  
FROM:


Code:
//$url_path = "/";  
TO:


Code:
$url_path = "/cacti/";  

***************************************************
Step Four:
***************************************************

Add a new user and then change the ownership and permissions of the rra and log directories.


Code:
adduser cactiuser
chown -R cactiuser /var/www/html/cacti/rra
chown -R cactiuser /var/www/html/cacti/log
chmod 777 -R /var/www/html/cacti/rra
chmod 777 -R /var/www/html/cacti/log  
***************************************************
Step Four:
***************************************************

Download and install RRDTool.


Code:
cd /tmp
wget http://oss.oetiker.ch/rrdtool/pub/rrdtool.tar.gz
tar zxvf rrdtool.tar.gz
cd rrdtool-1.4.7
./configure
make prefix=/usr/local/ all
make prefix=/usr/local/ install  
***************************************************
Step Five:
***************************************************

Start MySQL, Sendmail, snmpd and Apache, and make sure they start on boot:


Code:
chkconfig httpd on --levels 235
chkconfig mysqld on --levels 235
chkconfig sendmail on --levels 235
chkconfig snmpd on --levels 235
service mysqld start
service httpd start
service sendmail start
service snmpd start  
***************************************************
Step Six:
***************************************************

Configuring MySQL


Code:
/usr/bin/mysql_secure_installation  
Then, you will be asked a few questions. Provide the following responses:


Code:
current root password is <LEAVE BLANK>
set root password to: <ENTER PASSWORD>
remove anonymous users <YES>
disallow remote root login <YES>
remove test database <YES>
reload privilege tables <YES>  
***************************************************
Step Seven:
***************************************************

Create the Cacti Database:


Code:
mysqladmin -u root -p create cacti
mysql -p cacti < /var/www/html/cacti/cacti.sql
mysql -u root -p mysql
GRANT ALL ON cacti.* TO cactiuser@localhost IDENTIFIED BY 'cactiuser';
flush privileges;
exit  
***************************************************
Step Eight:
***************************************************

Set up Cacti via the web interface:


Code:
http://<ip_address>/cacti  

***************************************************
Step Nine:
***************************************************

Add a cron job to make the Cacti poll every 5 minutes. Note: The username used here must be the same as the one created in Step 4.


Code:
nano /etc/crontab
*/5 * * * * cactiuser php /var/www/html/cacti/poller.php > /dev/null 2>&1  
***************************************************
Step Ten:
***************************************************

If your "Localhost" is staying in the "Unknown" state and is not transitioning to the "Up" state, turn on SNMPv1 in its "Device Configuration" and change its "Downed Device Detection" to "SNMP Uptime".
***************************************************
Step Eleven:
***************************************************

Due to a bug in 8.8 (which will be resolved in 8.8a), users cannot import templates (see cacti 0.8.8 templates issue for more information). To resolve this issue, download global_arrays.php from the SVN here and put it in your <cacti_dir>/include/ directory.
***************************************************
All Done!
***************************************************

And now your done! http://forums.cacti.net/images/smilies/icon_smile.gif
As mentioned above, if there are any unnecessary packages or if you have any suggestions, please let me know and I'll be happy to make the corrections.
Last edited by Voiper99 on Sun Apr 15, 2012 6:26 pm, edited 2 times in total.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-110681-1-1.html 上篇帖子: [教程]FreeBSD下安装cacti教程(原创) 下篇帖子: cacti快速安装
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表