前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >linux工具类之流量监视

linux工具类之流量监视

作者头像
全栈程序员站长
发布2021-12-23 13:43:29
1.2K0
发布2021-12-23 13:43:29
举报
文章被收录于专栏:全栈程序员必看

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过速的错误数

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2021年8月28日 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档