• 3款Linux网络监视工具


    1 iftop:

    如果你想看到现在你的带宽到底是哪些应用在使用,并且各个应用占据了多少带宽的时候,可以用iftop显示出来.使用的参数如下:

    -h                  display this message

       -n                  don't do hostname lookups

       -N                  don't convert port numbers to services

       -p                  run in promiscuous mode (show traffic between other

                           hosts on the same network segment)

       -b                  don't display a bar graph of traffic

       -B                  Display bandwidth in bytes

       -i interface        listen on named interface

       -f filter code      use filter code to select packets to count

                           (default: none, but only IP packets are counted)

       -F net/mask         show traffic flows in/out of IPv4 network

       -G net6/mask6       show traffic flows in/out of IPv6 network

       -l                  display and count link-local IPv6 traffic (default: off)

       -P                  show ports as well as hosts

       -m limit            sets the upper limit for the bandwidth scale

       -c config file      specifies an alternative configuration file

       -t                  use text interface without ncurses

       Sorting orders:

       -o 2s                Sort by first column (2s traffic average)

       -o 10s               Sort by second column (10s traffic average) [default]

       -o 40s               Sort by third column (40s traffic average)

       -o source            Sort by source address

       -o destination       Sort by destination address

       The following options are only available in combination with -t

       -s num              print one single text output afer num seconds, then quit

       -L num              number of lines to print

    如果你只有一个网络接口,直接运行iftop就可以了,如果你有多个则需要通过-i来指定比如我们的使用iftop -i wlp2s0.显示如下,左边一列是源地址,显示的是域名.中间则是显示的目的地址也就是使用的网络,后面则是速率

    最下面还展示了接受和发出的包大小.以及总共的计算.

    在页面中你也可以在命令运行时更改显示选项:

    切换帮助界面

    n 是否解析域名

    s 切换源地址显示

    S 是否显示端口号

    t 切换文本显示界面

    p 暂停显示更新

    q 推出程序

    N 是否解析端口

    nethogs

    nethogs是个快速而简单的方法,需要用root身份制定要监听的接口,它会显示应用程序以及进程号,所以在你想杀死某个进程的时候,你可以通过这个命令查找到进程号.

    nethogs的命令参数如下:

       Options

           -h     display available commands usage.

           -V     prints Version info.

           -d     delay for refresh rate.

           -v     select view mode

           -p     sniff in promiscious mode (not recommended).

           -t     tracemode.

           -c     limit number of refreshes

           -s     sort by traffic sent

    显示页面的命令比较少,只有如下几个:

           m      cycle between display modes (kb/s, kb, b, mb)

           r      sort by 'received'

           s      sort by 'sent'

           q      quit

    vnstat:

    vnstat实时的显示所有的网络数据.

    你也可以通过这几种方式过滤数据显示:

    h: 按小时显示统计信息

    -d 按天显示统计信息

    -w 按周显示信息

    -m 按月显示信息

    -l 查看实时更新

  • 相关阅读:
    12个国外优秀.Net开源项目
    CYQ.Data 轻量数据层之路 V4.3 版本发布[增加对SQLite,MySQL数据库的支持]
    秋色园QBlog V2.5 后台管理系统源码发布下载
    秋色园QBlog技术原理解析:认识整站处理流程(二)
    CYQ.Data 数据框架 加快开源速度 发布V1.5.5版本源码
    秋色园[CYQ.Data]开源团队寻人
    秋色园QBlog技术原理解析:页面内容填充及多语言翻译流程演示示例(十)
    CYQ.Data 数据框架 性能评测
    框架设计:实现数据的按需更新与插入的改进
    秋色园QBlog技术原理解析:Module之基类生命周期页面加载(七)
  • 原文地址:https://www.cnblogs.com/zhanghongfeng/p/8384265.html
Copyright © 2020-2023  润新知