diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2021-03-03 22:39:05 +0000 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2021-03-03 22:39:05 +0000 |
commit | 64f4004d605cd0e576c3fc3fec95a7f118b4f20e (patch) | |
tree | b3f0b28b9f0f8f75c8e83bf15f1b7092508e1b2e /services.py | |
parent | 5d330852b8b390af41717e0fdb47a689cc18bd77 (diff) | |
download | boymoder.blog-64f4004d605cd0e576c3fc3fec95a7f118b4f20e.tar.gz boymoder.blog-64f4004d605cd0e576c3fc3fec95a7f118b4f20e.zip |
fixed dependencies
Diffstat (limited to 'services.py')
-rw-r--r-- | services.py | 21 |
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 |