找回密码
 注册
搜索
热搜: 回贴

好用的服务器流量监控软件

2010-1-30 22:10| 发布者: admin| 查看: 22| 评论: 0|原作者: 冰淇淋

NetPerSec
开源的 MRTG. 商业的 Solarwinds, WhatsUp Gold
DU Meter
建议你现在使用 Cacti 一个替代 MRTG的软件
××××××××××××××××××××
RedHat Linux AS 4 Cacti Install Guide:

tar vxzf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache --enable-so
make && make install
/usr/local/apache/bin/apachectl start
cp /usr/local/apache/bin/apachectl /etc/init.d/httpd
chmod a+x /etc/init.d/httpd
vi /etc/init.d/httpd
在第三行加入如下两行:
# chkconfig: 345 85 15
# description: Starts and stops the Apache HTTP Server.
保存退出:wq
chkconfig --add httpd


groupadd mysql
useradd -g mysql mysql
tar vxzf mysql-5.0.37.tar.gz
cd mysql-5.0.37
./configure --prefix=/usr/local/mysql
make
make install
cp support-files/my-medium.cnf /etc/my.cnf
cp support-files/mysql.server /etc/init.d/mysql
chmod a+x /etc/init.d/mysql
chkconfig --add mysql
chkconfig --level 3 mysql on
cd /usr/local/mysql
bin/mysql_install_db --user=mysql
chown -R mysql.mysql /usr/local/mysql
bin/mysqld_safe --user=mysql &

tar vxzf php-5.2.0.tar.gz
cd php-5.2.0
./configure --prefix=/usr/local/php \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-config-file-path=/usr/local/php \
--with-mysql=/usr/local/mysql \
--with-zlib-dir=/usr/include \
--enable-sockets \
--with-gd
make && make install
cp php.ini-dist /usr/local/php/php.ini
vi /usr/local/apache/conf/httpd.conf
加入:
###############for php and cacti###################
AddType application/x-tar .tgz
AddType application/x-httpd-php .php
AddType image/x-icon .ico
DirectoryIndex index.php index.html index.html.var
#######################over########################
保存退出:wq
/usr/local/apache/bin/apachectl restart



/usr/local/mysql/bin/mysql -uroot
mysql> create database cacti;
mysql> grant all on cacti.* to root;
mysql> grant all on cacti.* to root@localhost;
mysql> grant all on cacti.* to cactiuser;
mysql> grant all on cacti.* to cactiuser@localhost;
mysql> set password for cactiuser@localhost=password('cactipw');
mysql> exit;

vi /usr/local/apache/htdocs/test.php
phpinfo( );
?>

vi /usr/local/apache/htdocs/mysqltest.php


$link=mysql_connect('localhost','root','');
mysql_select_db('mysql');
$str="select * from user;";
$result=mysql_query($str,$link);
$show=mysql_num_rows($result);
mysql_close($link);
for ($i=0;$i < $show;$i++)
{
$arr[$i]=mysql_fetch_array($result);
};
?>
















service mysql restart
service httpd restart
http://YourIP/test.php 和 http://YourIP/mysqltest.php

http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.0.x/
tar vxzf rrdtool-1.0.50.tar.gz
cd rrdtool-1.0.50
./configure --prefix=/usr/local/rrdtool
make && make install


rpm -qa | grep net-snmp
net-snmp-5.1.2-11.EL4.7
net-snmp-devel-5.1.2-11.EL4.7
net-snmp-perl-5.1.2-11.EL4.7
net-snmp-libs-5.1.2-11.EL4.7
net-snmp-utils-5.1.2-11.EL4.7
vi /etc/snmp/snmpd.conf
com2sec notConfigUser default public
com2sec notConfigUser 127.0.0.1 public
access notConfigGroup "" any noauth exact systemview none none
access notConfigGroup "" any noauth exact all none none
#view all included .1 80
view all included .1 80

http://www.cacti.net/download_cacti.php
cp cacti-0.8.6j.tar.gz /usr/local/apache/htdocs/
cd /usr/local/apache/htdocs/
tar vxzf cacti-0.8.6j.tar.gz
mv cacti-0.8.6j cacti
cd cacti
/usr/local/mysql/bin/mysql -uroot cacti < cacti.sql
cd scripts
vi /usr/local/apache/htdocs/cacti/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 = "cactiuser";
$database_password = "cactipw";
$database_port = "3306";

crontab -e
*/5 * * * * root /usr/local/php/bin/php /usr/local/apache/htdocs/cacti/poller.php > /dev/null 2>&1

参考
http://www.i170.com/article/21268
http://bbs.chinaunix.net/viewthread....extra=page%3D2
×××××××××××××××××××××××××××××××××
Cacti http://84824.com/article.asp?id=102


HostUserPassword

最新评论

相关分类

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

GMT+8, 2024-10-1 17:32 , Processed in 0.131773 second(s), 12 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.