• nload


    nload
    用途: 用来即时监看网路状态和各ip所使用的频宽(很废话了)
    nload默认的是eth0网卡,如果你想监测eth1网卡的流量

    1
    nload eth1

    nload默认分为上下两块:上半部分是:Incoming也就是进入网卡的流量,下半部分是:Outgoing,也就是从这块网卡出去的流量,每 部分都有当前流量(Curr),平均流量(Avg),最小流量(Min),最大流量(Max),总和流量(Ttl)这几个部分,看起来还是蛮直观的.
    另外,你也可以自己定义流量数值显示的单位
    #nload –help
    就可以看到具体的相关参数了.

    查看网络平均流量

    下面的脚本可以很好的监控你的网络的平均流量,你可以提定时间

    01
    02
    03
    04
    05
    06
    07
    08
    09
    10
    11
    12
    13
    14
    15
    16
    17
    18
    #!/bin/bash
    echo -n "which nic?"
    read eth
    echo "the nic is "$eth
    echo -n "how much seconds:"
    read sec
    echo "duration is "$sec" seconds, wait please..."
    infirst=$(awk '/'$eth'/{print $1 }' /proc/net/dev |sed 's/'$eth'://')
    outfirst=$(awk '/'$eth'/{print $10 }' /proc/net/dev)
    sumfirst=$(($infirst+$outfirst))
    sleep $sec"s"
    inend=$(awk '/'$eth'/{print $1 }' /proc/net/dev |sed 's/'$eth'://')
    outend=$(awk '/'$eth'/{print $10 }' /proc/net/dev)
    sumend=$(($inend+$outend))
    sum=$(($sumend-$sumfirst))
    echo $sec" seconds total :"$sum"bytes"
    aver=$(($sum/$sec))
    echo "avrage :"$aver"bytes/sec"

     

  • 相关阅读:
    WinCE 测试网速
    YII 关联表查询
    YII CMenu配置
    php扩展开发笔记1
    使用Mysql EXPLAIN分析、优化SQL语句
    使用Mysql EXPLAIN分析、优化SQL语句 (续)
    jquery提交中文导致乱码
    *nix 命令记(持续更新)
    php 函数中使用static
    xmlhttprequest获取TransferEncoding:chunked分时编码输出
  • 原文地址:https://www.cnblogs.com/lexus/p/2568668.html
Copyright © 2020-2023  润新知