cacti监控(2)正式安装rrdtool cacti
apache mysql php已经安装好了,接下来就是进入主题了(请看:http://wolfword.blog.运维网.com/blog/4892126/1203250)
rrdtool是用来做绘图用的,但是还是需要其他的安装包的支持, cairo-devel libxml2-devel pango pango-devel 等,这里我们用yum安装没有必要一一的编译安装,太浪费时间了
1,rrdtool安装
http://blog.运维网.com/attachment/201305/200909128.jpg
# tar zvxf rrdtool-1.4.4.tar.gz
# cd rrdtool-1.4.4
# ./configure --prefix=/usr/local/rrdtool
# make && make install
# ln -s /usr/local/rrdtool/bin/* /usr/local/bin/
2,snmp安装
在这里我就直接用yum安装了
# yum-y install net-snmp*
# servicesnmpd restart
Stopping snmpd:
Starting snmpd:
# chkconfig snmpd on
3,cacti安装
# mv cacti-0.8.7g/* /usr/local/apache/htdocs/
# mysql -uroot -p123456
Welcome to the MySQL monitor.Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.1.49-log MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> create database cacti; 创建cacti数据库
Query OK, 1 row affected (0.09 sec)
mysql> insert into mysql.user(host,user,password) values('localhost','cacti',password('cacti123')); 在数据库里面创建cacti用户
Query OK, 1 row affected, 3 warnings (0.10 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.04 sec)
mysql> grant all on cacti.* to cacti@'localhost' identified by 'cacti123';
把数据库cacti授权给cacti用户
Query OK, 0 rows affected (0.03 sec)
# useradd cactiuser 创建本地cacti用户
# cd /usr/local/apache/htdocs/
# mysql -ucacti -pcacti123 cacti < cacti.sql
将数据倒入数据库cacti之后要修改配置文件以保证能与数据库cacti连接
# mysql -ucacti -pcacti123 cacti < cacti.sql
# pwd
/usr/local/apache/htdocs
# vim include/config.php
http://blog.运维网.com/attachment/201305/195758719.jpg
改完之后就可以见证奇迹了
结果显示的是空白页,很是郁闷!! 查看日志
# tail error_log
File does not exist: /usr/local/apache/htdocs/favicon.ico
caught SIGTERM, shutting down
module php5_module is already loaded, skipping
Apache/2.2.11 (Unix) PHP/5.2.9 configured -- resuming normal operations Apache/2.2.11 (Unix) PHP/5.2.9 configured -- resuming normal operations
在httpd.conf文件中添加如下行
AddType image/x-icon .ico
关闭selinux还是不行
唉唉,搞了两天问题还是没有解决~~~~~~~~~~~~~~ 不知道为什么一直都显示的是空白页,请高手帮助
皇天不负有心人,经过12小时的艰苦奋斗!! 问题终于被我解决了。。。。归根到底是php不能连接mysql导致的!!。。。究早期根本原因是当时编译安装php的时候的问题,我用的版本是php-5.3.25 所以在编译安装的时候应该是--with-mysql 而不是--with-mysql-dir因为在这个版本的php编译安装的时候根本就没有这个参数。。但是有人这样安装的时候居然成功了,不理解!!
在编译安装之前还要安装mysql-devel这个包
如果安装出现如下错误就用如下的非常规方法!!!!
/usr/local/mysql/lib/libmysqlclient.so: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make: *** Error 1
# cd /usr/local/mysql
# mv lib lib.back
# ln -s /usr/lib64/mysql/ /usr/local/mysql/lib
成功了!!!!!!!!!!!!!!!!!!
http://blog.运维网.com/attachment/201305/203248149.jpg
页:
[1]