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安装

[root@localhost tmp]# rpm -ivh nethogs-0.8.0-1.el6.x86_64.rpm 

warning: nethogs-0.8.0-1.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]

   1:nethogs                ########################################### [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. T-Sql编程基础
  2. 【python】题目:有1、2、3、4个数字,能组成多少个互不相同且无重复数字的三位数?都是多少?
  3. 异常之Tomcat7.0服务器无法发布项目
  4. YII框架概念与安装
  5. Jmeter之录制脚本(二)
  6. ahjesus 部署lighttpd
  7. CUDA Memories--CUDA记忆体(翻译+整理+测试)
  8. List使用Foreach 修改集合时,会报错的解决方案 (Error: Collection was modified; enumeration operation may not execute. ) - 摘自网络
  9. Java学习----main详解
  10. IOS学习之十七:Grand Central Dispatch(GCD)编程基础
  11. tabbar 嵌套 navigation
  12. POJ 1325 ZOJ 1364 最小覆盖点集
  13. ASP.NET MVC最新特性
  14. 一步一步创建ASP.NET MVC5程序[Repository+Autofac+Automapper+SqlSugar](一)
  15. Java NIO之缓冲区
  16. java垃圾回收诡异现象
  17. 为什么TCP比UDP可靠真正原因,以及并发编程的基础问题
  18. Linux 破坏性修复
  19. Redis的内存回收机制
  20. bat生成vbs通过注册表禁用或启用USB端口

热门文章

  1. (转载)基于LBS地图的开发,满足地图上有头像的需求
  2. 让你的JS更优雅的小技巧
  3. java基础--java.util.Date类型小结
  4. 12306火车票查询--python
  5. C# 异步操作 async await
  6. php页面静态化技术;学习笔记
  7. 自己实现简单的AOP(四)自动初始化代理对象
  8. [C#] 获取打印机列表
  9. jquery easyui使用(二)······可折叠面板动态加载无效果
  10. WCF入门教程(二)如何创建WCF服务