Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1219442
  • 博文数量: 135
  • 博客积分: 10576
  • 博客等级: 上将
  • 技术积分: 1670
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-11 20:49
个人简介

不疯魔,不成活! --疯魔老杨(Crazy.LaoYang) http://www.inotes.cn/

文章分类

全部博文(135)

文章存档

2014年(4)

2012年(13)

2011年(5)

2010年(30)

2009年(56)

2008年(27)

分类: LINUX

2009-11-18 23:55:24

[原创]个人笔记:NTop的安装以及与Cacti的结合
源自:杨志刚博客 (http://yangzhigang.cublog.cn)
 
下载、解压
[root@centos53 /]# cd /usr/local/src
[root@centos53 /]# wget
[root@centos53 /]# tar zxvf ntop-0.1.tar.gz
 
MV to cacti/plugins
[root@centos53 /]# mv ntop/ /var/www/cacti/plugins/
 
ADD && Active
[root@centos53 /]# vi /var/www/cacti/include/global.php
$plugins = array();
  $plugins[] = 'ntop';
 
Cacti Configure
[Plugin Management]:    ntop status:Old Plugin Architecture -Running
[User Management]:      admin----View NTop
 
查看
点顶部标签:NTop 出错,ERROR_INTERNET_CANNOT_CONNECT   。
[root@centos53 plugins]# netstat -ant |grep :3000
可以发现系统没有listen 3000端口。
其实,以上操作只是在cacti中加了一个ntop的标签而以(也可以说是一个外壳),还有一个比以上操作还要简单一点的方法就是用superlinks插件做一个TOP TAB(name:NTop),URL为:是一样的效果。
另,通过find / -name ntop* 查一下,也可以发再根本就没有ntop程序。
 
下载安装ntop程序
[root@centos53 /]# yum -y install ntop
 
NTop主要文件目录的说明
/etc/ntop.conf               //配置文件
/etc/logrotate.d/ntop        //滚动日志
/etc/rc.d/init.d/ntop        //ntop服务
/usr/lib/ntop                //ntop库文件
/usr/share/ntop              //ntop文档文件目录
/usr/bin/ntop                //ntop程序
 
NTop配置文件
[root@centos53 /]# vi /etc/ntop.conf
--user ntop               //用户名
--db-file-path /var/ntop  //数据库存放路径
--interface eth0          //接收数据包的网卡
--use-syslog              //记录日志
--http-server 3000        //运行端口
--daemon                  //守护进程方式运行
 
NTop第一次启动(初始化)
[root@centos53 /]# less /usr/share/doc/ntop-3.3.8/1STRUN.txt  //第一次运行说明
The (recommended) minimal command line is:
/usr/bin/ntop -P -u -A
#-P [directory]指定.db档存放路径
#-u [user]指定service启动user
#-A 设定admin密码,ntop会内建admin管理者帐号于ntop中
 
如:
[root@centos53 /]# /usr/bin/ntop -P /var/ntop -u ntop -A
Fri Nov 13 14:36:23 2009  NOTE: Interface merge enabled by default
Fri Nov 13 14:36:23 2009  Initializing gdbm databases
 
ntop startup - waiting for user response!
Please enter the password for the admin user: admin
Please enter the password again: admin
Fri Nov 13 14:37:09 2009  Admin user password has been set
以上操作ntop初始化就完成了。
 
启动运行
[root@centos53 /]# /usr/bin/ntop @/etc/ntop.conf &
或加入启动脚本
[root@centos53 /]# echo "/usr/bin/ntop @/etc/ntop.conf &" >>/etc/rc.d/rc.local
 
浏览
 
查看Cacti中的TOP TAB:NTop
我的正常,你的呢?
 
另:如要安装更新一点的NTop,可以采用源码安装。
也可以不用yum -y install ntop的方式安装,而是采用源码、配置、编译的方式安装。
=-=-=-=-=-=-=-=-=-=-=-=-=-=源码安装-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  _   _ _
  | \ | | |_ ___  _ __
  |  \| | __/ _ \| '_ \
  | |\  | || (_) | |_) |
  |_| \_|\__\___/| .__/
                 |_|
                       Network Top
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 
 
 
 
 
 
阅读(9328) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~