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

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

最新文章

  1. 前端小知识点---html换行被解析为空格的相关知识
  2. Grumpy: Go 上运行 Python!
  3. HP “云图”GPU虚拟化工作站解决方案
  4. sqlserver中对时间类型的字段转换
  5. 去掉hive字段中的tab
  6. 建议入门-用ArcMap进行空间查询与空间连接
  7. 容易被忽略的事----sql语句中select语句的执行顺序
  8. [Twisted] deferred
  9. JS-Math内置对象
  10. BZOJ 3390: [Usaco2004 Dec]Bad Cowtractors牛的报复
  11. Eclipse中将含有图片资源的项目打包成jar文件
  12. 灵玖软件NLPIRParser智能文本聚类
  13. 安卓仿QQ红包领取详情界面动画
  14. synchronized修饰方法和代码块的区别
  15. data.go
  16. SpringCloud警告(Eureka):EMERGENCY! EUREKA MAY BE INCORRECTLY CLAIMING INSTANCES ARE UP WHEN THEY'RE NOT. RENEWALS ARE LESSER THAN THRESHOLD AND HENCE THE INSTANCES ARE NOT BEING EXPIRED JUST TO BE SAFE.
  17. mybatis的foreach标签
  18. oracle 变量
  19. Java - 线程让步和休眠
  20. ibatis.net:第二天,Hello,World ?

热门文章

  1. Visual Studio跨平台开发实战(3) - Xamarin iOS多页面应用程式开发
  2. Web服务器Raspkate的RESTful API
  3. 正确Linux新手很实用20命令
  4. Unity UGUI——开源
  5. Ubuntu 13.10 安装 Unity 8 试用截图
  6. python常用类型的内置函数列表
  7. RabbitMQ与java、Spring结合实例详细讲解(转)
  8. 【转】C# string和StringBuilder的区别
  9. atitit.404错误调查过程汇总
  10. Redis源代码分析(23)--- CRC循环冗余算法RAND随机数的算法