|
@@ -1,5 +1,6 @@
|
|
|
import urllib.request
|
|
|
import json
|
|
|
+import requests
|
|
|
|
|
|
def notify_group(msg):
|
|
|
#'WekCRfnAirSiSxALiD6gcm0B56EejsoK89zFbIaiZQD' is ChoozmoTeam
|
|
@@ -11,7 +12,11 @@ def notify_group(msg):
|
|
|
try:
|
|
|
contents = urllib.request.urlopen("https://www.choozmo.com:8887/checkStatus").read()
|
|
|
status_dict = json.loads(contents.decode('utf-8'))
|
|
|
-
|
|
|
+ if len(status_dict['errors'])==0:
|
|
|
+ print('Everything works fine')
|
|
|
+ else:
|
|
|
+ for msg in status_dict['errors']:
|
|
|
+ notify_group('ERROR : '+msg+' down')
|
|
|
except:
|
|
|
err_msg = 'ERROR : 8887 status api down'
|
|
|
print(err_msg)
|