Remove router alive check

This commit is contained in:
2022-06-21 09:04:47 +00:00
parent 0c546d71aa
commit d73798656d

View File

@@ -24,15 +24,6 @@ def result():
def safe():
app.logger.info('Initializing safe reboot process')
# Try to ping the router 50 times
for i in range(50):
if call(['ping', '-c', '1', url], stdout=DEVNULL, stderr=STDOUT) == 0:
app.logger.info('Router is online')
break
else:
app.logger.error('Router is offline')
return 'Error: Unable to ping and reboot router automatically!'
# Try to nslookup 5 different websites to see if DNS is working
websites = ['www.google.com', 'www.facebook.com', 'www.twitter.com', 'www.reddit.com', 'www.amazon.com']
success = 0
@@ -74,3 +65,4 @@ def force():
def grafana():
if request.json['state'] == 'alerting':
return safe()
return "State is OK!"