摘自:

http://www.cnblogs.com/kerrycode/p/4748970.html

NetHogs介绍

NetHogs是一款开源、免费的,终端下的网络流量监控工具,它可监控Linux的进程或应用程序的网络流量。NetHogs只能实时监控进程的网络带宽占用情况。NetHogs支持IPv4和IPv6协议,支持本地网卡以及PPP链接。

官方介绍如下:

NetHogs is a small 'net top' tool. Instead of breaking the traffic down per protocol or per subnet, like most tools do, it groups bandwidth by process. NetHogs does not rely on a special kernel module to be loaded. If there's suddenly a lot of network traffic, you can fire up NetHogs and immediately see which PID is causing this. This makes it easy to indentify programs that have gone wild and are suddenly taking up your bandwidth.

NetHogs下载

NetHogs的开源代码在sourceforge上提供下载,它只提供源代码下载。http://sourceforge.net/projects/nethogs/?source=directory。如果你需要下载RPM安装包,可以去这个网址下载

Ubuntu下NetHogs安装

sudo apt-get install nethogs

ReadHat下NetHogs安装

warning: nethogs-0.8.0-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
########################################### [100%]
########################################### [100%]
[root@localhost tmp]# 

源码安装由于测试过程安装失败,再次不做讲述

NetHogs使用

[root@localhost tmp]# nethogs

NetHogs提供交互式控制指令:

m : Cycle between display modes (kb/s, kb, b, mb) 切换网速显示单位

r : Sort by received. 按接收流量排序

s : Sort by sent. 按发送流量排序

q : Quit and return to the shell prompt. 退出NetHogs命令工具

NetHogs 命令行参数

常用的参数:

-d delay for refresh rate. 数据刷新时间 如nethogs -d 1 就是每秒刷新一次

-h display available commands usage. 显示命名帮助、使用信息

-p sniff in promiscious mode (not recommended).

-t tracemode.

-V prints Version info.

演示例子:

#5秒刷新一次数据

nethogs -d 5

#监控网卡eth0数据

nethogs eth0

#同时监视eth0和eth1接口

nethogs eth0 eth1

#将监控日志写入日志文件
nethogs >>test.log

参考资料:

http://rpm.pbone.net/index.php3/stat/4/idpl/17273936/dir/redhat_el_6/com/nethogs-0.8.0-1.el6.x86_64.rpm.html

http://sourceforge.net/projects/nethogs/?source=directory

最新文章

  1. 6个奇葩的(hello,world)C语言版(转)
  2. 多线程(pthread、NSThread、GCD)
  3. listed
  4. linux:/etc/rc.local 不能自动启动问题
  5. 不容错过错的xcode 插件 转至于cocoachina
  6. 利用flashback query 恢复表数据
  7. OpenGL1-创建窗口(建立Win32的OpenGL开发环境 )(代码上传)
  8. 用jquery写了个选项卡,当作一个笔记吧。
  9. LVM的一般操作过程
  10. 第九周LINUX 学习笔记
  11. DS博客作业01--日期抽象数据类型设计与实现
  12. 聊聊JVM(二)说说GC的一些常见概念
  13. Linux 第八天
  14. 关于 TypeReference 的解释
  15. 新建一个去除storyboard的项目
  16. spring-boot添加自定义拦截器
  17. urllib2模块初体验———豆瓣读书页面下载小爬虫
  18. EJB实体Bean怎样和数据库中表关联?
  19. Android应用开发学习笔记之Fragment
  20. Servlet与JSP九大内置对象的对应关系

热门文章

  1. winform中tabControl的标题隐藏
  2. Redis 在 Java 中的使用
  3. Python标准库:1. 介绍
  4. 读刘未鹏老大《你应当怎样学习C++(以及编程)》
  5. vim  模式查找
  6. Apc缓存Opcode(转)
  7. FZU 2124 FOJ 2124 吃豆人【BFS】
  8. hdu1316
  9. rtems 4.11 启动流程(arm, beagle)
  10. 有一个长为n的数组A,求满足0≤a≤b<n的A[b]-A[a]的最大值。 给定数组A及它的大小n,请返回最大差值。