diff --git a/scraper.py b/scraper.py index 002edbb..dd958f9 100644 --- a/scraper.py +++ b/scraper.py @@ -10,22 +10,14 @@ import subprocess ssh_key = "/key/location" ssh_user= "theguy" -#dictionary defining servers, their ip and ssh port +#create dictionary defining servers, their ip and ssh port from json + +try: + with open("/root/servers.json") as f: + servers = json.load(f) +except FileNotFoundError: + raise RuntimeError("servers json file not found") -servers = { - "server1": { - "ip": "1.2.3.4", - "port": 1 - }, - "server2": { - "ip": "5.6.7.8", - "port": 2 - }, - "fakelol": { - "ip": "200.200.200.200", - "port": 22222 - }, -} #load previous state of servers, to avoid constant alert spam try: