精华内容
下载资源
问答
  • Linux最好的网络流量进出查看工具-iptraf yum install iptraf -y iptraf-ng

    Linux最好的网络流量进出查看工具-iptraf

    yum install iptraf -y
    iptraf-ng
    

    在这里插入图片描述

    展开全文
  • 转载地址:https://askubuntu.com/questions/450604/how-to-get-the-current-upload-and-download-speeds-in-terminal 以上就是linux记录网卡流量信息。
    展开全文
  • Linux-流量访问监控

    千次阅读 2017-09-29 11:55:17
    常用流量监控命令: nload iptraf-ng nethogs iftop

    常用流量监控命令:

    1. nload
    2. iptraf-ng
    3. nethogs
    4. iftop

    nload(监控网卡进出状态)

    #启动监控
    root@kali:~# nload 
    #配合测试
    root@kali:~# ab -n 10000 https://www.baidu.com/index.html
    

    这里写图片描述
    这里写图片描述

    root@Kali:~# nload --help
    
    nload version 0.7.4
    Copyright (C) 2001 - 2012 by Roland Riegel <feedback@roland-riegel.de>
    nload comes with ABSOLUTELY NO WARRANTY. This is free software, and you are
    welcome to redistribute it under certain conditions. For more details see the
    GNU General Public License Version 2 (http://www.gnu.org/copyleft/gpl.html).
    
    Command line syntax:
    nload [options] [devices]
    nload --help|-h
    
    Options:
    -a period       Sets the length in seconds of the time window for average
                    calculation.
                    Default is 300.
    -i max_scaling  Specifies the 100% mark in kBit/s of the graph indicating the
                    incoming bandwidth usage. Ignored if max_scaling is 0 or the
                    switch -m is given.
                    Default is 10240.
    -m              Show multiple devices at a time; no traffic graphs.
    -o max_scaling  Same as -i but for the graph indicating the outgoing bandwidth
                    usage.
                    Default is 10240.
    -t interval     Determines the refresh interval of the display in milliseconds.
                    Default is 500.
    -u h|b|k|m|g    Sets the type of unit used for the display of traffic numbers.
       H|B|K|M|G    h: auto, b: Bit/s, k: kBit/s, m: MBit/s etc.
                    H: auto, B: Byte/s, K: kByte/s, M: MByte/s etc.
                    Default is h.
    -U h|b|k|m|g    Same as -u, but for a total amount of data (without "/s").
       H|B|K|M|G    Default is H.
    devices         Network devices to use.
                    Default is to use all auto-detected devices.
    --help
    -h              Print this help.
    
    example: nload -t 200 -i 1024 -o 128 -U M
    
    
    root@Kali:~# ab --help
    ab: wrong number of arguments
    Usage: ab [options] [http[s]://]hostname[:port]/path
    Options are:
        -n requests     Number of requests to perform
        -c concurrency  Number of multiple requests to make at a time
        -t timelimit    Seconds to max. to spend on benchmarking
                        This implies -n 50000
        -s timeout      Seconds to max. wait for each response
                        Default is 30 seconds
        -b windowsize   Size of TCP send/receive buffer, in bytes
        -B address      Address to bind to when making outgoing connections
        -p postfile     File containing data to POST. Remember also to set -T
        -u putfile      File containing data to PUT. Remember also to set -T
        -T content-type Content-type header to use for POST/PUT data, eg.
                        'application/x-www-form-urlencoded'
                        Default is 'text/plain'
        -v verbosity    How much troubleshooting info to print
        -w              Print out results in HTML tables
        -i              Use HEAD instead of GET
        -x attributes   String to insert as table attributes
        -y attributes   String to insert as tr attributes
        -z attributes   String to insert as td or th attributes
        -C attribute    Add cookie, eg. 'Apache=1234'. (repeatable)
        -H attribute    Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
                        Inserted after all normal header lines. (repeatable)
        -A attribute    Add Basic WWW Authentication, the attributes
                        are a colon separated username and password.
        -P attribute    Add Basic Proxy Authentication, the attributes
                        are a colon separated username and password.
        -X proxy:port   Proxyserver and port number to use
        -V              Print version number and exit
        -k              Use HTTP KeepAlive feature
        -d              Do not show percentiles served table.
        -S              Do not show confidence estimators and warnings.
        -q              Do not show progress when doing more than 150 requests
        -l              Accept variable document length (use this for dynamic pages)
        -g filename     Output collected data to gnuplot format file.
        -e filename     Output CSV file with percentages served
        -r              Don't exit on socket receive errors.
        -m method       Method name
        -h              Display usage information (this message)
        -I              Disable TLS Server Name Indication (SNI) extension
        -Z ciphersuite  Specify SSL/TLS cipher suite (See openssl ciphers)
        -f protocol     Specify SSL/TLS protocol
                        (SSL2, TLS1, TLS1.1, TLS1.2 or ALL)
    

    iptraf-ng(图形化工具)

    #启动监控程序
    root@kali:~# iptraf-ng 
    #配合测试
    root@kali:~# ab -n 10000 https://www.baidu.com/index.html
    

    这里写图片描述这里写图片描述

    root@Kali:~# iptraf-ng --help
    usage: iptraf-ng [options]
       or: iptraf-ng [options] -B [-i <iface> | -d <iface> | -s <iface> | -z <iface> | -l <iface> | -g]
    
        -h, --help            show this help message
    
        -i <iface>            start the IP traffic monitor (use '-i all' for all interfaces)
        -d <iface>            start the detailed statistics facility on an interface
        -s <iface>            start the TCP and UDP monitor on an interface
        -z <iface>            shows the packet size counts on an interface
        -l <iface>            start the LAN station monitor (use '-l all' for all LAN interfaces)
        -g                    start the general interface statistics
    
        -B                    run in background (use only with one of the above parameters
        -f                    clear all locks and counters
        -t <n>                run only for the specified <n> number of minutes
        -L <logfile>          specifies an alternate log file
    
    

    nethogs(监控进程出入)

    #启动监控程序
    root@kali:~# nethogs
    

    这里写图片描述

    root@Kali:~# nethogs --help
    nethogs: invalid option -- '-'
    usage: nethogs [-V] [-h] [-b] [-d seconds] [-v mode] [-c count] [-t] [-p] [-s] [device [device [device ...]]]
    		-V : prints version.
    		-h : prints this help.
    		-b : bughunt mode - implies tracemode.
    		-d : delay for update refresh rate in seconds. default is 1.
    		-v : view mode (0 = KB/s, 1 = total KB, 2 = total B, 3 = total MB). default is 0.
    		-c : number of updates. default is 0 (unlimited).
    		-t : tracemode.
    		-p : sniff in promiscious mode (not recommended).
    		-s : sort output by sent column.
       -a : monitor all devices, even loopback/stopped ones.
    		device : device(s) to monitor. default is all interfaces up and running excluding loopback
    
    When nethogs is running, press:
     q: quit
     s: sort by SENT traffic
     r: sort by RECEIVE traffic
     m: switch between total (KB, B, MB) and KB/s mode
    
    

    iftop(监控IP出入)

    #启动监控程序
    root@kali:~# iftop
    

    这里写图片描述

    root@Kali:~# iftop --help
    iftop: unknown option --
    iftop: display bandwidth usage on an interface by host
    
    Synopsis: iftop -h | [-npblNBP] [-i interface] [-f filter code]
                                   [-F net/mask] [-G net6/mask6]
    
       -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
    
    
    展开全文
  • 此脚本可列出一定时间的流量及平均流量。时间可自己设置。#!/usr/bin/env pythonimport time,sysdef all_flow(INTERFACE):f = open('/proc/net/dev')flow_info=f.readlines()in_flow=[]out_flow=[]for eth_dev in ...

    此脚本可列出一定时间的流量及平均流量。时间可自己设置。

    #!/usr/bin/env python

    import time,sys

    def all_flow(INTERFACE):

    f = open('/proc/net/dev')

    flow_info=f.readlines()

    in_flow=[]

    out_flow=[]

    for eth_dev in flow_info:

    if INTERFACE in eth_dev:

    in_flow.append(int(eth_dev.split(':')[1].split()[0]))

    out_flow.append(int(eth_dev.split(':')[1].split()[9]))

    f.close()

    return in_flow,out_flow

    def format_flow(flow):

    flow_n = float(flow)

    if flow_n > 1000000:

    return '%.3f MB' % (flow_n/1024/1024)

    else:

    return '%.3f KB' % (flow_n/1024)

    if __name__=='__main__':

    if len(sys.argv) > 1:

    INTERFACE = sys.argv[1]

    else:

    INTERFACE = 'eth'

    in_flows = {}

    out_flows = {}

    all_flows0 = all_flow(INTERFACE)

    count = 0

    while count < 5:

    time.sleep(1)

    all_flows1=all_flow(INTERFACE)

    for x in range(len(all_flows0[0])):

    if len(sys.argv) >1:

    curr_eth = INTERFACE

    else:

    curr_eth = 'eth%s' % x

    if len(in_flows) == x:

    in_flows[curr_eth]= []

    out_flows[curr_eth]=[]

    print curr_eth+" in:"+ format_flow(all_flows1[0][x]-all_flows0[0][x])+" out:"+\

    format_flow(all_flows1[1][x]-all_flows0[1][x])

    in_flows[curr_eth].append(all_flows1[0][x]-all_flows0[0][x])

    out_flows[curr_eth].append(all_flows1[1][x]-all_flows0[1][x])

    all_flows0 = all_flows1

    count=count+1

    for key in in_flows:

    sum_a=0

    in_flow=''

    for i in in_flows[key]:

    sum_a = sum_a+i

    in_flow = in_flow + format_flow(i) + ' '

    #print key + ' flow_in is: %s'% in_flow

    print key +" average of flow_in is: %s" % format_flow(sum_a/count)

    for key in out_flows:

    sum_a=0

    out_flow=''

    for i in out_flows[key]:

    sum_a = sum_a+i

    out_flow = out_flow + format_flow(i) + ' '

    #print key + ' flow_out is: %s'% out_flow

    print key +" average of flow_out is: %s" % format_flow(sum_a/count)

    默认为列出除lo以外的所有网卡的流量。也可在运行时加入网卡名作为参数如:eth0 或eth1等等。比较懒,没有做参数判断。也就是参数里输入任何字符串都不会报错,当然脚本运行获取的结果也就不会正确。

    展开全文
  • linux查看流量命令

    千次阅读 2021-05-09 04:22:36
    Linux系统下想要查看网络流量,那我们该使用那个命令呢?下面由学习啦小编为大家整理了linux查看网络流量的命令的相关知识,希望对大家有帮助。linux查看网络流量命令大全linux查看网络流量方法一、nload工具查看参数...
  • 首先我从cacti 中监控到了一台放在机房的服务器流量异常,何为异常这里说一下:本身这台服务器交换机中限制带宽为两兆峰值,而他却可以跑到100M,按正常情况来说,当你的服务器流量跑满的时候,你的机器会很卡、远程...
  • 如题所示,在配置zabbix监控服务器并预警的时候,有两项最基本的监控,分别是:网卡进出流量变化情况、不同磁盘分区空间变化情况。其次,在配置完监控之后,还需要设置对应的触发器,从而在满足我们指定条件时邮件或...
  • 1、本脚本可自定义欲查看接口,精确到小数,并可根据流量大小灵活显示单位。2、此脚本的采集间隔为1秒。3、此脚本不需要额外再安装软件,可在急用情况下应付一下,比如临时想看一下是否有流量通过,大概为多少等。4...
  • Linux网络流量监控工具

    千次阅读 2020-07-21 07:00:00
    前言我们的很多服务大都是部署在Linux服务器上的,我们在生产中可能会遇见很多问题,如网络慢,访问卡等,那么就需要对Linux的机器的网络流量进行监控,这样我们才能分析排查问题。接下来介...
  • 理论上能正常运行ifconfig的Linux操作系统都可适用这个脚本(当然一般默认会安装perl),打印实时网卡流量和丢包数,好久前当时为了验证输出流量随手写的,多次想改得漂亮点,一直没动手,就这样吧,以免用的时候找不...
  • shell脚本监控linux网卡流量(上传/下载/流入/流出)从网上.../bin/sh#filename: monitor_eth_flow.v2.sh#功能: 监控网卡进出流量#用法:# sh monitor_eth_flow.v2.sh# sh monitor_eth_flow.v2.sh eth0# sh monitor_eth...
  • Linux 流量监控

    2021-02-19 11:21:27
    在类Linux系统中可以使用top查看系统资源、进程、内存占用等信息。查看网络状态可以使用netstat、nmap等工具。若要查看实时的网络流量,监控TCP/IP连接等,则可以使用iftop。 iftop类似于top的实时流量监控工具,...
  • Linux下如何对端口流量进行统计

    千次阅读 2020-12-20 22:55:01
    在不修改源代码的情况下对程序暴露端口流量进行监控统计,可以利用Linux中自带的Iptable添加简单的规则让其起到端口流量统计的作用。但是需要注意的是在服务器重启、Iptable服务重启的时候统计数据会被重置清零。...
  • linux流量查看工具汇总

    千次阅读 2020-12-20 22:54:55
    时时了解服务器的流量占用情况,是运维人员要掌握的一个入门技能。不过查看流量的情况的手段很多,工具也很多。...一、iptraf在最的常用的linux发行版centos、redhat源中,可以直接通过yum进行安装。当然...
  • 它是一个实时监控网络流量和带宽使用的控制台应用程序,使用两个图表可视化地展示接收和发送的流量,并提供诸如数据交换总量、最小/最大网络带宽使用量等附加信息。2. 安装nload以CentOS7.5最小化安装版为例,系统并...
  • 1、nload,左右键切换网卡 2、sudo iftop 3、sudo iptraf 按连接/端口查看流量   4、sudo nethogs: 按进程查看流量占用 5、ss: 连接查看工具 6、dstat -nf  
  • 通常,我们会通过这几种方式查看Linux服务器的实时网卡流量。 1、sar –n DEV 1 2 sar命令包含在sysstat工具包中,提供了基于网络接口的数据统计,也可以查看设备上每秒收发包的个数和流量。上面命令的含义是:向...
  • ifstat介绍ifstat工具是个网络接口监测工具,比较简单看网络流量实例默认使用#ifstateth0 eth1KB/s in KB/s out KB/s in KB/s out0.07 0.20 0.00 0.00 0.07 0.15 0.58 0.00默认ifstat不监控回环接口,显示的流量单位...
  • 本文介绍了linux下查看网卡流量的六种方法,linux系统中使用nload、iftop、iostat等工具查看网卡流量,需要的朋友参考下。 方法一、nload工具 源码包路径: ... 查看参数帮助命令: nload–help ...
  • 常用命令iftop -i eth0iftop -i eth1iftop -i enp1s0Linux中查看网卡流量工具有iptraf、iftop以及nethogs等,iftop可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息等。安装iftop的命令如下:...
  • 比较直观 2.sar 计量脚本 sar(System Activity Reporter 系统活动情况报告)是目前 Linux 上最为全面的系统性能分析工具之一,可以从多方面对系统的活动进行报告,包括:文件的读写情况、系统调用的使用情况、磁盘 ...
  • 方法一、nload工具源码包路径:查看参数帮助命令:nload –help-a:这个好像是全部数据的刷新时间周期,单位是秒,默认是300.-i:进入网卡的流量图的显示比例最大值设置,默认10240 kBit/s.-m:不显示流量图,只显示...
  • 由于作linux经常会要作linux下的流量查看,下面的三个方法能很好的解决当前流量查看.注:我认为nload很破,不许.安装方法,请查个人另外一个文章,linux的rpm高级管理.pythoniftop工具linux用途: 用来即时监看网路状态...
  • linux流量分析

    千次阅读 2019-01-02 15:10:01
    查看流量端口号 sudo iftop -i -P n-&gt; 显示主机ip和主机名 N-&gt; 显示端口号或者端口服务名称 P-&gt; 暂定或者继续 根据端口号查询进程 netstat -nap | grep port 查看进程信息: ps -aux | ...
  • linux网络流量查看命令

    千次阅读 2018-08-11 17:24:40
    网卡流量 1、iftop命令 iftop可以用来监控网卡的实时流量(可以指定网段)、反向解析IP、显示端口信息、TCP/IP连接等官网:http://www.ex-parrot.com/~pdw/iftop/ 安装iftop: [root@Super ~]# yum install flex ...
  • 这些工具使用不同的机制来制作流量报告。nload等一些工具可以读取"proc/net/dev"文件,以获得流量统计信息;而一些工具使用pcap库来捕获所有数据包,然后计算总数据量,从而估计流量负载。 下面是按功能划分的命令...
  • -P显示主机以及端口信息,这个参数非常有用 -F显示特定网段的网卡进出流量 如:iftop -F 192.168.12.0/24 -m设置iftop输出界面中最上面的流量刻度最大值,流量刻度分五个大段显示 iftop使用: 安装好iftop后,可以...
  • 一、iptraf软件源码安装wget ftp://iptraf.seul.org/pub/iptraf/iptraf-3.0.0.tar.gztar zxvf iptraf-3.0.0.tar.gzcd iptraf-3.0.0./Setupyum方式安装yum install -y iptraf1.2 iptraf使用[root@kaifa ...IP流量监...

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 4,590
精华内容 1,836
关键字:

linux进出流量

linux 订阅