aboutsummaryrefslogtreecommitdiffstats
path: root/services.py
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2021-03-03 22:39:05 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2021-03-03 22:39:05 +0000
commit64f4004d605cd0e576c3fc3fec95a7f118b4f20e (patch)
treeb3f0b28b9f0f8f75c8e83bf15f1b7092508e1b2e /services.py
parent5d330852b8b390af41717e0fdb47a689cc18bd77 (diff)
downloadboymoder.blog-64f4004d605cd0e576c3fc3fec95a7f118b4f20e.tar.gz
boymoder.blog-64f4004d605cd0e576c3fc3fec95a7f118b4f20e.zip
fixed dependencies
Diffstat (limited to 'services.py')
-rw-r--r--services.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/services.py b/services.py
index 32edb5d..69c0eae 100644
--- a/services.py
+++ b/services.py
@@ -3,7 +3,7 @@ import qbittorrent
import datetime
import docker
import clutch
-import pihole
+import pihole as ph
import queue
import json
import time
@@ -55,7 +55,6 @@ def timeout(func):
@timeout
def get_docker_stats():
-
client = docker.DockerClient(base_url = "tcp://%s:%s" % (app.CONFIG["docker"]["url"], app.CONFIG["docker"]["port"]))
return {
container.name: container.status
@@ -99,17 +98,17 @@ def get_trans_stats():
@timeout
def get_pihole_stats():
- ph = pihole.PiHole(app.CONFIG["pihole"]["url"])
+ pihole = ph.PiHole(app.CONFIG["pihole"]["url"])
return {
- "status": ph.status,
- "queries": ph.total_queries,
- "clients": ph.unique_clients,
- "percentage": ph.ads_percentage,
- "blocked": ph.blocked,
- "domains": ph.domain_count,
- "last_updated": str(datetime.datetime.fromtimestamp(ph.gravity_last_updated["absolute"]))
+ "status": pihole.status,
+ "queries": pihole.total_queries,
+ "clients": pihole.unique_clients,
+ "percentage": pihole.ads_percentage,
+ "blocked": pihole.blocked,
+ "domains": pihole.domain_count,
+ "last_updated": str(datetime.datetime.fromtimestamp(pihole.gravity_last_updated["absolute"]))
}
if __name__ == "__main__":
- print(get_pihole_stats()) \ No newline at end of file
+ print(get_qbit_stats()) \ No newline at end of file