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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 省赛准备阶段

    省赛准备阶段

    2021年9月27日
    34
  • springmvc源码下载_idea jar包导入

    springmvc源码下载_idea jar包导入1.首先需要下载源码码云地址:https://gitee.com/mirrors/Spring-Framework.git很快推荐GitHub地址:https://github.com/spring-projects/spring-framework.git不推荐然后打开idea,下载源码2.下载并配置gradle环境下载地址:https://services…

    2022年8月12日
    32
  • vue报错:无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称[通俗易懂]

    vue报错:无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称[通俗易懂]1.vue报错:无法将“vue”项识别为 cmdlet、函数、脚本文件或可运行程序的名称

    2022年8月18日
    23
  • Pytest+Allure安装

    Pytest+Allure安装文章目录1.Pytest环境安装2.Window环境下Allure安装3.Linux环境下Allure安装1.Pytest环境安装#在线安装pip3installpytestpip3installpytest-rerunfailurespip3installpytest-htmlpip3installpytest-repeatpip3installpytest-assumepip3installallure-pytest#离线安装-先在线下载pip3

    2022年7月26日
    6
  • Java代码生成器[通俗易懂]

    Java代码生成器[通俗易懂]项目说明本项目基于是基于renren-generator定制的代码生成器文章目录**项目说明**不同点:效果原理分析如何定制开发?更多可能存在的坑代码地址不同点:因为本人的公司使用的是tkmyabtis+swagger构建restapi,而renren-generator用的是mybatis-plus,而且不支持swagger,所以有了本项目效果…

    2022年4月27日
    53
  • kafka删除topic中的数据_kafka删除数据

    kafka删除topic中的数据_kafka删除数据删除topic里面的数据这里没有单独的清空数据的命令,这里要达到清空数据的目的只需要以下步骤:一、如果当前topic没有使用过即没有传输过信息:可以彻底删除。二、如果当前topic有使用过即有过传输过信息:并没有真正删除topic只是把这个topic标记为删除(markedfordeletion)。想要彻底删除topic数据要经过下面两个步骤:①:删除topic,重新用创建to…

    2022年10月16日
    4

发表回复

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

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