Linux系统之iftop的基本使用
Linux系统之iftop的基本使用
- 一、iftop介绍
- 二、检查本地系统环境
- 1.检查系统版本
- 2.检查系统内核版本
- 三、检查yum仓库状态
- 四、安装iftop工具
- 1.使用yum安装iftop
- 2.查看iftop版本与命令帮助
- 五、iftop的基本使用
- 1.直接使用iftop命令
- 2.iftop的显示说明
- 3.指定监控某块网卡
- 4.直接显示IP
- 5.显示某个网段进出封包流量
一、iftop介绍
iftop是一款实时流量监控工具,监控TCP/IP连接等,缺点就是无报表功能。必须以root身份才能运行。
二、检查本地系统环境
1.检查系统版本
[root@jeven ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
2.检查系统内核版本
[root@jeven ~]# uname -r
6.1.8-1.el7.elrepo.x86_64
三、检查yum仓库状态
[root@jeven ~]# yum repolist all |grep enable
base/7/x86_64 CentOS-7 - Base - mirrors.a enabled: 10,072
docker-ce-stable/7/x86_64 Docker CE Stable - x86_64 enabled: 198
elrepo ELRepo.org Community Enterp enabled: 154
epel/x86_64 Extra Packages for Enterpri enabled: 13,740
extras/7/x86_64 CentOS-7 - Extras - mirrors enabled: 515
updates/7/x86_64 CentOS-7 - Updates - mirror enabled: 4,691
四、安装iftop工具
1.使用yum安装iftop
本次yum仓库配置使用的是阿里云的镜像源,可直接使用yum安装iftop。
[root@jeven ~]# yum -y install iftop
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile* elrepo: mirrors.tuna.tsinghua.edu.cn* epel: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package iftop.x86_64 0:1.0-0.21.pre4.el7 will be installed
--> Finished Dependency ResolutionDependencies Resolved====================================================================================================================================================================Package Arch Version Repository Size
====================================================================================================================================================================
Installing:iftop x86_64 1.0-0.21.pre4.el7 epel 53 kTransaction Summary
====================================================================================================================================================================
Install 1 PackageTotal download size: 53 k
Installed size: 94 k
Downloading packages:
iftop-1.0-0.21.pre4.el7.x86_64.rpm | 53 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : iftop-1.0-0.21.pre4.el7.x86_64 1/1 Verifying : iftop-1.0-0.21.pre4.el7.x86_64 1/1 Installed:iftop.x86_64 0:1.0-0.21.pre4.el7 Complete!
2.查看iftop版本与命令帮助
查看iftop的命令帮助,显示版本为iftop, version 1.0pre4。
[root@jeven ~]# iftop -h
iftop: display bandwidth usage on an interface by hostSynopsis: 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 otherhosts on the same network segment)-b don't display a bar graph of traffic-B display bandwidth in bytes-a display bandwidth in packets-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 ncursesSorting 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 addressThe 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 printiftop, version 1.0pre4
copyright (c) 2002 Paul Warren <pdw@ex-parrot.com> and contributors
五、iftop的基本使用
1.直接使用iftop命令
直接输入iftop,默认监控的是第一块网卡。
iftop #默认是监控第一块网卡的流量
2.iftop的显示说明
- 第一部分
iftop 输出中最上面的一行,此行信息是流量刻度,用于显示网卡带宽流量。
- 第二部分
1.中间的<= =>这两个左右箭头,表示的是流量的方向。
2.其中又分别分为左、中、右三列。左列和中列,记录了哪些 IP 或主机正在和本机的网络进行连接。其中,中列的“=>”代表发送数据,“<=”代表接收数据,通过这个指示箭头可以很清晰地知道两个 IP 之间的通信情况。
3.最右列又分为三小列,这些实时参数分别表示外部 IP 连接到本机 2 秒内、10 秒内和 40 秒内的平均流量值。
- 第三部分
分割线最下面的一部分,用来统计网卡流量信息。
TX:发送流量
RX:接收流量
TOTAL:总流量
Cumm:运行iftop到目前时间的总流量
peak:流量峰值
rates:分别表示过去 2s 10s 40s 的平均流量
3.指定监控某块网卡
[root@jeven ~]# iftop -i ens33
4.直接显示IP
直接显示IP, 不进行DNS反解析
5.显示某个网段进出封包流量
iftop -F 192.168.3.0/24
Linux系统之iftop的基本使用相关推荐
- Linux系统下使用iftop结合iptables服务解决带宽被恶意请求的问题
Linux系统下使用iftop结合iptables服务解决带宽被恶意请求的问题 最近博客总时不时的打不开,出现数据库连接错误,或者是打开巨慢.不知道哪个s.b盯着我不放,打开控制面板,发现能登录, ...
- linux查看流量开源,Linux流量监控工具 - iftop
Linux流量监控工具 - iftop -------------------------------------------------------------------------------- ...
- 系统管理员都要知道的 30 个 Linux 系统监控工具
1. top - 进程活动监控命令 top 命令会显示 Linux 的进程.它提供了一个运行中系统的实时动态视图,即实际的进程活动.默认情况下,它显示在服务器上运行的 CPU 占用率最高的任务,并且每 ...
- linux系统被***后处理经历
linux系统被***后处理经历 背景 操作系统:Ubuntu12.04_x64 运行业务:公司业务系统,爬虫程序,数据队列. 服务器托管在外地机房. 突然,频繁收到一组服务器ping监控不可达邮件, ...
- Linux流量监控工具 - iftop (最全面的iftop教程)
Linux流量监控工具 - iftop (最全面的iftop教程) 2010年07月27日 下午 | 作者:VPS侦探 在类Unix系统中可以使用top查看系统资源.进程.内存占用等信息.查看网络状态 ...
- linux 日志监控工具,详解 Linux系统常用监控工具
8种机械键盘轴体对比 本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选? top 命令有点类似于 Windows下的任务管理器,能够实时动态地监控并显示系统中各个进程的资源占用状况,是 Linu ...
- linux ps 只显示端口,这30个Linux系统监控工具,每个系统管理员都应该知道
是否需要监控Linux服务器的性能?试试这些内置的命令和附加工具.大多数发行版都附带了大量的Linux监控工具,这些工具提供了可以用来获取系统活动信息的指标.你可以使用这些工具来查找性能问题的可能原因 ...
- 查询Linux系统网卡流量负载,超好用linux系统查询网卡等流量参数的工具,分享给大家!!!...
超好用linux系统查询网卡等流量参数的工具,分享给大家!!! 工作中大家或许会遇到这类情况:托管服务器流量超出限额,可是突然又不能像windows主机那样通过QQ管家或者360卫士等软件工具那样很直 ...
- linux系统监控命令汇总
零.Linux系统监控命令速查手册 命令 功能应用 用法举例 free 查看内存使用情况,包括物理内存和虚拟内存 free -h或free -m vmstat 对系统的整体情况进行统计 ...
最新文章
- Python 使用 itchat+pillow 实现微信消息自动回复
- 电路基本概念有哪些?
- strcmp可以比较数组么_C语言数组越界了,后果很严重,如何避免?
- select 移动端 第一个无法选中_总结在移动端碰到的坑
- android 屏幕坐标色彩,Android自定义View实现颜色选取器
- 第2章[2.7] Ext JS数据模型与数据封装
- 安装unity3d多个版本共存
- 引入log4j日志包为何会自动导入额外两个包(门面模式)
- Gns3模拟器配置Cisco ASA防火墙
- 【光学】Matlab实现色散曲线拟合
- echarts:柱状图去掉网格线
- html圣诞效果,HTML5实现圣诞树效果
- 刷脸支付人工智能和商业领域进一步融合
- 在手机桌面隐藏App的Icon并启动该App
- 计算机跨考英语口译,英语专业跨考
- P2P对等网络技术原理整合
- linux番茄时钟,Linux 番茄时钟 定时 取消 快捷方式
- 中国最美高铁,90分钟穿过57个国家级风景区,一站一景沿途全都美哭了。
- 帮你解决简历最难写部分,提高面试几率!
- 苹果4s怎么显示无服务器,苹果4s连接电脑没有反应怎么办 苹果4s怎么连接电脑...