Comments (5)
没事了已经解决
from serverstatus-hotaru.
今天遇到类似问题,网速统计不正确,写下自己的解决方法,以后有碰到同样问题的朋友,可参考下
修改方法:修改status-client.py文件的代码,具体代码在类Traffic的get方法中,将不需要统计流量的网卡接口排除即可
根据status.sh可知,status-client.py文件在/usr/local/ServerStatus/client目录下
先用 cat /proc/net/dev
命令查看网卡有哪些,我的是:lo、eth0、docker0、br-1bfaa12c35f1、vethf0edf50、veth9b7a34d
实际上,我只需要统计eth0的流量,其他都不要,在代码中排除即可
将原代码
if dev[0].strip() == "lo" or dev[0].find("tun") > -1
改成
if dev[0].strip() == "lo" or dev[0].strip() == "docker0" or dev[0].find("br-") > -1 or dev[0].find("veth") > -1 or dev[0].find("tun") > -1
最后用 bash status.sh c
命令重启客户端
from serverstatus-hotaru.
@laogui2008 谢谢,这个issue打开后直接关闭了。我没有看到这个issue,如果使用vnStat计算流量的话应该不会存在这个问题,因为是指定网口的。或许我们把流量计算默认直接排除掉docker的流量比较好?
from serverstatus-hotaru.
@cokemine 一般来说,大部分人在使用过程中应该是很少关注docker内网的流量使用情况的,更多的是关注对外的流量使用情况。理论上,为了适应大部分人的使用习惯,是应该排除掉docker内网的流量比较好。但使用docker虚拟出来的网卡,不同的机子得到的可能是不一样的,排除起来可能有一些困难。该怎么排除,需要考虑考虑。
事实上,可能同时使用docker和探针的人比较少,所以提出相关issue不多。
如果真要做,就要辛苦大佬你了。
from serverstatus-hotaru.
fix in 56b5587
from serverstatus-hotaru.
Related Issues (20)
- [错误] ServerStatus 服务端解压失败 HOT 2
- 昨晚就不更新了 HOT 2
- 能不能出docker 版的 HOT 1
- 如何移除卡片模式?
- 如何移除卡片模式?
- Ubuntu 22.10 负载为0
- gcc编译报错,服务端启动失败
- 请问如何更换域名
- 一会运行中,一会维护中
- 国内服务器无法部署 HOT 1
- 这个怎么说? HOT 7
- 两个小小的功能请求
- 安装后全维护中
- 请教什么是服务端什么是客户端
- openwrt,esxi是否能支持 HOT 3
- 解决国内无法安装的问题-优化脚本 HOT 1
- 无法停止服务端 HOT 2
- 同时安装ServerStatus和Cockpit出现服务器数据是NAN HOT 2
- 服务端拒绝通信 HOT 1
- 求问alpine系统客户端应该如何安装
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serverstatus-hotaru.