From d73798656daa942e99cd0ccb7f467828267fe55c Mon Sep 17 00:00:00 2001 From: Nikolaos Karaolidis Date: Tue, 21 Jun 2022 09:04:47 +0000 Subject: [PATCH] Remove router alive check --- src/app.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/app.py b/src/app.py index a1bb813..b487ba3 100644 --- a/src/app.py +++ b/src/app.py @@ -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!"