linux工具类之流量监视

linux工具类之流量监视

iptraf        好用                                                                            yum install iptraf
iptraf  is an ncurses-based IP LAN monitor that generates various network statistics including TCP info, UDP counts, ICMP and OSPF information, Ethernet,load info, node stats, IP checksum errors, and others.If the command is issued without any command-line options, the program comes up in interactive mode, with the various facilities  accessed  through  the main menu.

ipband

nethogs
安装nethogs
yum -y install nethogs
(1)、可以实时查看系统当前进程的流量
(2)、可以和nload结合起来,可以诊断出很多问题。
如果要将这些数据记录到日志里,可以使用下面的命令:
nethogs -b | tee log.txt

nload        不自带    简单直观
wget http://www.roland-riegel.de/nload/nload-0.7.2.tar.gz
tar zxvf nload-0.7.2.tar.gz
cd nload-0.7.2
./configure;make;make install
使用
直接用nload回车即可,也可以指定网卡,如nload eth1
还可以指定是以K或M来显示流量,如nload -u M显示的流量是以MB为单位的
看看还有哪些参数或选项
[root@wdlinux ~]# nload -u K
[root@wdlinux ~]# nload -h

ifstat        不自带    简单直观
Ifstat is a little tool to report interface activity, just like iostat/vmstat do for other system statistics.
ifstat gathers these statistics from the kernel internal counters, which is highly operating system dependent.Right now, the following systems are supported:
    Linux >= 2.2.0 (through /proc/net/dev file).
    FreeBSD >= 2.2 (using the ifmib(4) interface).
    Solaris >= 5.6 (using the kstat(3K) interface).
    IRIX and OpenBSD (using the SIOCGIFDATA ioctl).
    NetBSD and Darwin (using the route(4) sysctl interface).
    Other BSDs (using the kvm(3) interface).
    Digital Unix (OSF/1), Tru64, and Aix (using the legacy kmem interface).
    HP-UX (using the DPLI streams interface).
    Win32 native or through Cygwin (using the GetIfTable call).
wget -S http://gael.roualland.free.fr/ifstat/ifstat-1.1.tar.gz
tar zxvf ifstat-1.1.tar.gz
cd ifstat-1.1
./configure
make;make install
ifstat

iftop        不自带

安装库文件,需要 libpcap 及 libcurses 。
yum install -y flex byacc libpcap ncurses ncurses-devel libpcap-devel

wget -S http://www.ex-parrot.com/~pdw/iftop/download/iftop-0.17.tar.gz
tar zxvf iftop-0.17.tar.gz
cd iftop-0.17                                                                        

./configure                                                                            make;make install
使用
iftop -i eth1 -B
iftop -i eth2 -B -m 30M
iftop -n -i eth1

iftop -i eth0 -n -P  显示端口号
http://jiajun.iteye.com/blog/419515

watch ifconfig
watch more /proc/net/dev
watch -n 1 “/sbin/ifconfig eth0 | grep bytes”
ulimit -n

[root@CactiEZ ~]# netstat -s
[root@CactiEZ ~]# sar -n DEV 1
[root@CactiEZ ~]# sar -n EDEV 1 2
-n参数很有用,他有6个不同的开关:DEV | EDEV | NFS | NFSD | SOCK | ALL 。
DEV显示网络接口信息,EDEV显示关于网络错误的统计数据,NFS统计活动的NFS客户端的信息,NFSD统计NFS服务器的信息,SOCK显示套接字信息,ALL显示所有5个开关。它们可以单独或者一起使用。
rxerr/s:每秒钟接收的坏数据包 txerr/s:每秒钟发送的坏数据包 coll/s:每秒冲突数
rxdrop/s:因为缓冲充满,每秒钟丢弃的已接收数据包数
txdrop/s:因为缓冲充满,每秒钟丢弃的已发送数据包数
txcarr/s:发送数据包时,每秒载波错误数
rxfram/s:每秒接收数据包的帧对齐错误数
rxfifo/s:接收的数据包每秒FIFO过速的错误数
txfifo/s:发送的数据包每秒FIFO过速的错误数

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/109867.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Stairway to SQLCLR Level 5: Development (Using .NET within SQL Server)

    Stairway to SQLCLR Level 5: Development (Using .NET within SQL Server)原文链接:http://www.sqlservercentral.com/articles/Stairway+Series/119429/BySolomonRutzky,2015/03/11TheSeriesThisarticleispartoftheStairwaySeries:StairwaytoSQLCLRThepossibil

    2022年7月20日
    12
  • Android版MT4使用方法,安卓版手机MT4使用手册「建议收藏」

    Android版MT4使用方法,安卓版手机MT4使用手册「建议收藏」一、安卓Android系统MT4下载安装1、下载安装:用户在安卓市场(应用市场)里直接输入MT4、“外汇交易软件”、“外汇交易系统”等进行搜索,选择左边图片中的软件后下载安装。(请认准下方标志)(MT4官方标志)2、登录:在成功安装后,会自动转跳到右图中的页面,客户根据自己的实际情况,选择登录模拟还是真实账户进行登录。3、选择服务器:客户需要在搜索框里输入“onef”系统会自动搜索出欧…

    2022年5月20日
    70
  • mysql商品表设计_商品数据库表设计

    mysql商品表设计_商品数据库表设计1.建库2.建表新建一个查询,粘贴下列代码,选中执行商品分类表:(主键没有自增)商品表:(主键没有自增)模型图:3.交叉查询

    2022年8月5日
    3
  • 基于Krack的网络攻击「建议收藏」

    基于Krack的网络攻击「建议收藏」更新软件包apt-getupdate安装相应的环境apt-getinstalllibnl-3-devlibnl-genl-3-devpkg-configlibssl-devnet-toolsgitsysfsutilspython-scapypython-pycryptodome下载Krack运行脚本gitclonehttps://github.com/…

    2022年6月10日
    36
  • 文科生也能学会的Excel VBA 宏编程入门

    文科生也能学会的Excel VBA 宏编程入门文章目录VBA宏编程简介准备工作打开宏功能打开“开发工具”选项卡VBA编程示例任务介绍文件宏全局宏VBA宏编程简介VBA编程是Office系列软件自带的编程功能,也就是说不只是Excel,Word和PPT也能进行VBA编程。而“宏”可以理解为一组自动化程序,执行一个宏就能执行其对应的一系列操作。创建宏主要有两种方法,一种是录制宏,也就是将人的一些操作录下来,需要的时候执行宏就可以自动重复这些操…

    2022年6月10日
    39
  • 从零到上亿用户,我是如何一步步优化MySQL数据库的?(建议收藏)[通俗易懂]

    从零到上亿用户,我是如何一步步优化MySQL数据库的?(建议收藏)[通俗易懂]冰河亲历的亿级流量下的MySQL优化实战,强烈建议收藏!!

    2022年5月22日
    39

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号