Comments (3)
这里的版本实现了使用vnstat来统计月度使用量
https://github.com/P3TERX/ServerStatus-V
大佬要不要考虑下也使用vnstat?
这个可以有,我支持!!
from serverstatus.
只需要把client.py的代码修正如下即可,感谢大佬的开发。
使用前一定要调试好vnstat,避免报错
def liuliang():
NET_IN = 0
NET_OUT = 0
vnstat=os.popen('vnstat --dumpdb').readlines()
for line in vnstat:
if line[0:4] == "m;0;":
mdata=line.split(";")
NET_IN=int(mdata[3])*1024*1024
NET_OUT=int(mdata[4])*1024*1024
break
return NET_IN, NET_OUT
from serverstatus.
vnstat更新版本(2.0以上)已经不支持--dumpdb参数,请使用:
def liuliang():
NET_IN = 0
NET_OUT = 0
vnstat=os.popen('vnstat --oneline b').readline()
mdata=vnstat.split(";")
NET_IN=int(mdata[8])
NET_OUT=int(mdata[9])
return NET_IN, NET_OUT
from serverstatus.
Related Issues (20)
- 配置了config.json但是全是断线状态 HOT 1
- 联通延迟测试是不是掉了呀 HOT 7
- 指定网卡 HOT 1
- 还是watchdog的规则问题&username=xxx HOT 8
- 显示OS和kernel HOT 1
- 关于延时的逻辑判断 HOT 12
- 流量重置的日期异常 HOT 16
- 突然所有客户端都连不上了,求问大佬如何排查 HOT 1
- 大佬能不能加个总流量的功能? HOT 1
- 请问watchdog要怎麽设置啊? HOT 1
- 关于测速和丢包 HOT 5
- 如何增加服务器显示数量? HOT 1
- vps和域名申请了证书,如何让他https访问? HOT 1
- 服务端和客户端一直连不上 HOT 3
- 请问是否可以在面板上加入月流量统计
- 1.1.2算发布了吗? HOT 1
- 关于WatchDog回调格式
- 提几个建议
- 通知规则的问题
- 如何設置客戶端自啓動
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.