Update scraper.py
This commit is contained in:
+7
-15
@@ -10,22 +10,14 @@ import subprocess
|
|||||||
ssh_key = "/key/location"
|
ssh_key = "/key/location"
|
||||||
ssh_user= "theguy"
|
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
|
#load previous state of servers, to avoid constant alert spam
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user