找回密码
 注册
搜索
热搜: 回贴
微赢网络技术论坛 门户 服务器 Linux/BSD 查看内容

cacti安装说明

2009-12-20 13:43| 发布者: admin| 查看: 59| 评论: 0|原作者: 青鸾峰




Normal
0

7.8 磅
0
2













MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
table.MsoTableGrid
{mso-style-name:网格型;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
border:solid windowtext 1.0pt;
mso-border-alt:solid windowtext .5pt;
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-border-insideh:.5pt solid windowtext;
mso-border-insidev:.5pt solid windowtext;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
text-align:justify;
text-justify:inter-ideograph;
mso-pagination:none;
font-size:10.0pt;
font-family:"Times New Roman";}
cacti安装说明
说明:cacti是一套开源的网络、服务器监控软件。
一、安装依赖的软件
1、安装apache


[root@monitor ~]# yum install httpd



检验是否安装成功:


[root@monitor cacti]# rpm -qa|grep httpd
system-config-httpd-1.3.3.3-1.el5
httpd-2.2.3-11.el5_1.centos.3
httpd-manual-2.2.3-11.el5_1.centos.3



2、安装mysql


[root@monitor ~]# yum install mysql mysql
server



检验是否安装成功:


[root@monitor cacti]# rpm -qa|grep mysql
mysql-5.0.45-7.el5
mysql-server-5.0.45-7.el5



3、安装php相关


[root@monitor ~]# yum install php
php-mysql php-snmp



检验是否安装成功:


[root@monitor cacti]# rpm -qa|grep
php
php-5.1.6-20.el5_2.1
php-common-5.1.6-20.el5_2.1
php-pdo-5.1.6-20.el5_2.1
php-cli-5.1.6-20.el5_2.1
php-mysql-5.1.6-20.el5_2.1
php-ldap-5.1.6-20.el5_2.1
php-snmp-5.1.6-20.el5_2.1



4、安装net-snmp相关


[root@monitor ~]# yum install net-snmp
net-snmp-utils



检验是否安装成功:


[root@monitor cacti]# rpm -qa|grep
net-snmp
net-snmp-5.3.1-24.el5_2.2
net-snmp-utils-5.3.1-24.el5_2.2
net-snmp-libs-5.3.1-24.el5_2.2
[root@monitor cacti]#



5、安装
当前版本为1.2.23-1,根据系统的版本下载相关版本,本例为CentOS5.2,所以下载el5的版本;
下载地址:http://oss.oetiker.ch/rrdtool/download.en.html


[root@monitor ~]# rpm -ivh
perl-rrdtool-1.2.23-1.el5.rf.i386.rpm rrdtool-1.2.23-1.el5.rf.i386.rpm
warning:
perl-rrdtool-1.2.23-1.el5.rf.i386.rpm: Header V3 DSA signature: NOKEY, key ID
6b8d79e6
Preparing...
########################################### [100%]

1:rrdtool
########################################### [ 50%]

2:perl-rrdtool
########################################### [100%]



6、将apache和mysql设置成自启动


[root@monitor ~]# chkconfig --add httpd
[root@monitor ~]# chkconfig httpd on
[root@monitor ~]# chkconfig --list|grep
httpd
httpd
0:off 1:off 2:on
3:on 4:on 5:on 6:off





[root@monitor ~]# chkconfig --add mysqld
[root@monitor ~]# chkconfig mysqld on
[root@monitor ~]# chkconfig --list|grep
mysqld
mysqld
0:off 1:off 2:on
3:on 4:on 5:on 6:off



7、手动启动mysql和httpd


[root@monitor ~]# /etc/init.d/mysqld
start
[root@monitor ~]# /etc/init.d/httpd start



8、修改mysql的root用户密码
这里值得提出的是,有很多人不修改mysql的缺省口令,这样会有很大的安全隐患。

修改root用户密码有很多种方法,这里只介绍一种。


[root@monitor ~]# mysql
Welcome to the MySQL monitor.
Commands end with ; or \g.
Your MySQL connection id is 30
Server version: 5.0.45 Source
distribution

Type 'help;' or '\h' for help. Type '\c'
to clear the buffer.

mysql> use mysql
Reading table information for completion
of table and column names
You can turn off this feature to get a
quicker startup with -A

Database changed
mysql> select host,user,password from
user;
------------ ------- ------------------
|
host | user |
password |
------------ ------- ------------------
| localhost | root
|
|
| domain.com | root
|
|
| 127.0.0.1 | root |
|
------------ ------- ------------------
4 rows in set (0.00 sec)


mysql> UPDATE user SET
Password=PASSWORD('YourPassWord') WHERE
User='root';

Query OK, 3 rows affected (0.01 sec)
Rows matched: 3 Changed: 3
Warnings: 0

mysql> select host,user,password from
user;

------------ ------- ------------------
|
host | user |
password |
------------ ------- ------------------
| localhost | root |
3661cf4xxd958bxx |
| domain.com | root |
3661cf4xxd958bxx |
| 127.0.0.1 | root |
3661cf4xxd958bxx |
------------ ------- ------------------
4 rows in set (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye
[root@monitor ~]# mysql
ERROR 1045 (28000): Access denied for
user 'root'@'localhost' (using password: NO)
[root@monitor ~]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.
Commands end with ; or \g.
Your MySQL connection id is 32
Server version: 5.0.45 Source
distribution

Type 'help;' or '\h' for help. Type '\c'
to clear the buffer.

mysql>



OK了,准备工作做完了,可以继续了!

二、安装cacti

1、创建cacti数据库


[root@monitor ~]# mysql -uroot -p
Enter password:
mysql> create database cacti;
mysql> GRANT ALL ON cacti.* TO
cacti@localhost IDENTIFIED BY 'YourPassWord';
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)




2、安装cacti
cacti是用php些的程序,所以下载下来,解压到apache的DocumentRoot目录下就可以了。
可以到官方网站去下载稳定版的版本。
官方网站:http://www.cacti.net
[root@monitor ~]# wget
http://www.cacti.net/downloads/cacti-0.8.7b.tar.gz

将cacti解压缩到apache的DocumentRoot目录下,由于此次是rpm默认安装的,位置在/var/www/html目录下。


[root@monitor ~]# tar zxvf
cacti-0.8.7b.tar.gz -C /var/www/html/cacti
[root@monitor ~]# cd /var/www/html/
[root@monitor html]# chown -R
apache.apache cacti



3、配置数据库连接参数
修改
include/config.php 文件,指定数据库类型,数据库名称,用户名,密码,端口等设置。


$database_type = "mysql";
$database_default = "cacti";
$database_hostname =
"localhost";
$database_username = "cacti";
$database_password =
"YourPassWord";



4、增加cacti用户,通过这个用户的crontab定时采集数据


[root@monitor cacti]# useradd cacti
[root@monitor cacti]# passwd cacti
Changing password for user cacti.
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated
successfully.
[root@monitor cacti]# pwd
/var/www/html/cacti
[root@monitor cacti]# chown -R cacti rra/
log/
[root@monitor html]# su - cacti
[cacti@monitor ~]$
[cacti@monitor ~]$ crontab -e
#在crontab里面增加一行,没5分钟采集一次。
*/5 * * * * php
/var/www/html/cacti/poller.php > /dev/null 2>&1




Normal
0

7.8 磅
0
2













MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}

Normal
0

7.8 磅
0
2













MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
5、通过浏览访问cacti

Normal
0

7.8 磅
0
2













MicrosoftInternetExplorer4

/* Style Definitions */
table.MsoNormalTable
{mso-style-name:普通表格;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:"Times New Roman";}
http://your.server.com/cacti
三、配置cacti
1、第一次通过web登录会出现一个安装向导,仔细夜读说明后按【Next>>】进入下一步;
2、选择New Install 按【Next>>】进入下一步;
3、这个页面会显示依赖的软件的位置,如果出现红色请仔细查看,并擦找原因,没有问题按【Finsh】完成设置;
4、重新登录到cacti页面,会让你输入密码,用户密码均为admin;
5、修改admin用户的密码,进入到cacti的页面。








最新评论

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-10-1 01:31 , Processed in 0.155672 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

返回顶部