RHEL5.4下Cacti+rrdtool+Netsnmp流量与性能监测系统安装(2)

七、安装net-snmp

软件包net-snmp-5.3.0.1.tar.gz

下载地址

#tar -zxvf net-snmp-5.3.0.1.tar.gz

#cd net-snmp-5.3.0.1

# ./configure --prefix=/usr/local/net-snmp --enable-developer

#make

#make install

# cp EXAMPLE.conf /usr/local/net-snmp/share/snmp/snmpd.conf

#vi /usr/local/net-snmp/share/snmpd.conf

找到以下内容并修改可访问SNMP网段和community

# sec.name source community

com2sec local localhost public

com2sec mynetwork network/netmask public

####

# ln -s /usr/local/net-snmp/bin/* /usr/local/bin/

#/usr/local/net-snmp/sbin/snmpd -c /usr/local/net-snmp/share/snmp/snmpd.conf     //启动SNMP

#echo "/usr/local/net-snmp/sbin/snmp –c /usr/local/net-snmp/share/snmp/snmpd.conf" >> /etc/rc.local   //加入开机启动

 

八、安装Cacti

软件包cacti-0.8.7f.tar.gz

下载地址

#tar -zxvf cacti-0.8.7f.tar.gz

#mv cacti-0.8.7f/* /usr/local/apache/htdocs/

#useradd cacti

#chown -R cacti /usr/local/apache/htdocs/rra

#chown -R cacti /usr/local/apache/htdocs

#chgrp -R cacti /usr/local/apache/htdocs/

 

九、建立数据库

1、登录MySQL,新建数据库,并授权

# /usr/local/mysql/bin/mysql -u root -p

Enter password: //输入密码

Welcome to the MySQL monitor. Commands end with ; or \g.

Your MySQL connection id is 1

Server version: 5.1.46 Source distribution

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.

This software comes with ABSOLUTELY NO WARRANTY. This is free software,

and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> create database cacti;

Query OK, 1 row affected (0.00 sec)

mysql> grant all on cacti.* to cacti@'localhost' identified by 'cactipassword';

Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)

mysql> exit;

2、导入cacti数据库

#cd /usr/local/apache/htdocs

#/usr/local/mysql/bin/mysql -uroot -p123456 cacti < cacti.sql

3、修改cacti安装配置文件

#vi /usr/local/apache/htdocs/include/config.php

/* make sure these values refect your actual database/host/user/password */

$database_type = "mysql";

$database_default = "cacti";

$database_hostname = "localhost";

$database_username = "cacti";

$database_password = "cactipassword";

$database_port = "3306";

/* Default session name - Session name must contain alpha characters */

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wywzxj.html