vnstat 2nd

This commit is contained in:
BennyThink 2021-12-09 21:15:36 +08:00
parent 831604881e
commit 6a54442241
No known key found for this signature in database
GPG key ID: 6CD0DBDA5235D481

10
db.py
View file

@ -40,6 +40,10 @@ class Redis:
%s
{vnstat_banner}
%s
{quota_banner}
%s
@ -49,10 +53,6 @@ class Redis:
{usage_banner}
%s
{vnstat_banner}
%s
"""
@ -114,7 +114,7 @@ class Redis:
else:
cmd = "/usr/bin/vnstat -i eth0".split()
vnstat_text = subprocess.check_output(cmd).decode('u8')
return self.final_text % (db_text, quota_text, metrics_text, usage_text, vnstat_text)
return self.final_text % (db_text, vnstat_text, quota_text, metrics_text, usage_text)
def reset_today(self):
pairs = self.r.hgetall("metrics")