centos8平台使用nethogs基于进程监控网络流量
2023-09-14 09:01:19 时间
一,nethogs的作用:
按进程或程序实时统计网络带宽使用率
我们查看流量的占用时,知道来源的ip、访问的端口,还不足以帮我们确认到进程,
而nethogs则可以让我们查看每个进程所占用的流量带宽
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
说明:作者:刘宏缔 邮箱: 371125307@qq.com
二,安装nethogs:
[root@yjweb ~]# yum install nethogs
说明:如果yum报错没有任何匹配,则先安装epel源
[root@localhost liuhongdi]# yum install epel-release
三,查看nethogs的版本
[root@yjweb ~]# nethogs -V version 0.8.5
四,查看帮助
[root@yjweb ~]# nethogs -help usage: nethogs [-V] [-h] [-b] [-d seconds] [-v mode] [-c count] [-t] [-p] [-s] [device [device [device ...]]] -V : prints version. -h : prints this help. -b : bughunt mode - implies tracemode. -d : delay for update refresh rate in seconds. default is 1. -v : view mode (0 = KB/s, 1 = total KB, 2 = total B, 3 = total MB). default is 0. -c : number of updates. default is 0 (unlimited). -t : tracemode. -p : sniff in promiscious mode (not recommended). -s : sort output by sent column. -a : monitor all devices, even loopback/stopped ones. device : device(s) to monitor. default is all interfaces up and running excluding loopback When nethogs is running, press: q: quit s: sort by SENT traffic r: sort by RECEIVE traffic m: switch between total (KB, B, MB) and KB/s mode
五,nethogs 的常用命令
1,每隔5秒刷新一次输出结果
[root@yjweb ~]# nethogs -d 5
说明:默认间隔是1秒
2,按发送的数据量倒排
[root@yjweb ~]# nethogs -s
说明:默认是按RECEIVE的数据量倒排
3,监控所有的网卡
[root@yjweb ~]# nethogs -a
4,监控指定的一个或多个网卡
[root@yjweb ~]# nethogs eth0 eth1
5,监测指定的次数
[root@yjweb ~]# nethogs eth0 -c 3
说明:次数更新完即退出
六,nethogs的交互指令
m : Cycle between display modes (kb/s, kb, b, mb) 切换网速显示单位
r : Sort by received. 按接收流量排序
s : Sort by sent. 按发送流量排序
q : Quit and return to the shell prompt. 退出NetHogs命令工具
七,查看当前的centos版本
[root@yjweb ~]# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)
相关文章
- 阿里云 ACK One 多集群管理全面升级:多集群服务、多集群监控、两地三中心应用容灾
- 大数据助银行提高征信水平和风险监控能力
- django 中进程监控工具flower的使用
- Java监控工具介绍,VisualVm ,JProfiler,Perfino,Yourkit,Perf4J,JProbe,Java微基准测试
- django 中进程监控工具flower的使用
- 使用Prometheus的Node-exporter监控Kubernetes的Node节点失败(dial tcp i/o timeout)问题解决
- golang gopsutil库的使用:进程和系统资源监控(CPU 内存 磁盘等)
- 基于NB-IoT的智慧路灯监控系统(NB-IoT专栏—实战篇5:手机应用开发)
- [手游项目2]-9-进程监控自动重启
- zabbix 监控特定进程
- 你的生产环境还在“裸奔”吗?给服务器上个监控吧
- 监控docker容器运行状态脚本shell
- linux 下监控某个进程的脚本-以frp为例
- LabVIEW监控VI中的执行时间和内存使用情况
- 监控之星-普罗米修斯Prometheus搭建
- Shell 脚本实战之报警监控
- Zabbix 监控常见服务
- Kubelet cAdvisor 资源监控
- 搭建zabbix4.0监控服务实例