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


相关推荐

  • levelDB 的版本控制[通俗易懂]

    首先本次类FileMetaData之前我们在LevelDB-总体介绍中提到一个疑问,levelDB是将磁盘文件以层的结构存在,那么哪里维护这个层结构呢,其实就是在Version类中,classVersion{public://Lookupthevalueforkey.Iffound,storeitin*valand//returnOK.Elsereturnanon-OKstatus.Fills*stats.//REQUIRES:

    2022年4月9日
  • django配置文件详解_pycharm配置django

    django配置文件详解_pycharm配置django前言django框架的日志通过python内置的logging模块实现的,既可以记录自定义的一些信息描述,也可以记录系统运行中的一些对象数据,还可以记录包括堆栈跟踪、错误代码之类的详细信息。log

    2022年7月30日
  • Deep Boltzmann Machines

    Deep Boltzmann Machines转载自:http://blog.csdn.net/win_in_action/article/details/25333671 http://blog.csdn.net/zouxy09/article/details/8775518深度神经网络(Deepneuralnetwork)   深度学习的概念源于人工神经网络的研究。含多隐层的多层感知器就是一种深度学习结构

    2022年7月13日
  • LSTM模型搭建_LSTM神经网络

    LSTM模型搭建_LSTM神经网络defLSTM_Classifier(self,train,trainLabel,test,testLabel,val_test,val_label,new_test=None):train,test=np.array(train),np.array(test)train,test=train.reshape(train.shape[0],1,train.shape[1]),test.reshape(test.shape[0],1,tes…

    2022年9月11日
  • pac模式与全局模式哪个好_ppp模式的优缺点

    pac模式与全局模式哪个好_ppp模式的优缺点众所周知,传统有一大弊端,即:只能使用全局模式,这样情况下,虽然可以加速国外网站,但打开国内网站速度会变慢;加速度不但支持全局模式,同时也支持PAC模式(智能分流,绕过中国大陆),这样情况下,既可以加速国外网站,也不会影响国内网站打开速度!温馨提示:安卓手机客户端、IOS客户端、MAC客户端均可根据自己实际使用需求,自由切换【PAC模式】或者【全局模式】,具体如何切换可查看相应客户端设置教程;…

    2022年10月19日
  • 35道SpringBoot面试题及答案,面试常被问到「建议收藏」

    35道SpringBoot面试题及答案,面试常被问到「建议收藏」作者:Arain|来源于:程序员面试SpringBoot是微服务中最好的Java框架.我们建议你能够成为一名SpringBoot的专家。本文精选了三十五个常见的SpringBoot知识点,祝你一臂之力!问题一SpringBoot、SpringMVC和Spring有什么区别?1、SpringSpring最重要的特征是依赖注入。所有SpringM…

    2022年6月7日

发表回复

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

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