update monitor

This commit is contained in:
Usman Nasir
2021-04-13 13:29:30 +05:00
parent c68b08d44a
commit a76bdb790c
3 changed files with 80 additions and 3 deletions

View File

@@ -2945,3 +2945,28 @@ class CloudManager:
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
def UptimeMonitor(self):
try:
try:
del self.data['controller']
del self.data['serverUserName']
del self.data['serverPassword']
except:
pass
CloudConfigPath = '/home/cyberpanel/cloud'
writeToFile = open(CloudConfigPath, 'w')
writeToFile.write(json.dumps(self.data))
writeToFile.close()
execPath = "/usr/local/CyberCP/bin/python /usr/local/CyberCP/plogical/ClusterManager.py --function UptimeMonitor --type All"
ProcessUtilities.executioner(execPath)
final_json = json.dumps({'status': 1})
return HttpResponse(final_json)
except BaseException as msg:
final_dic = {'status': 0, 'fetchStatus': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)

View File

@@ -50,6 +50,8 @@ def router(request):
return cm.DetachCluster()
elif controller == 'DebugCluster':
return cm.DebugCluster()
elif controller == 'UptimeMonitor':
return cm.UptimeMonitor()
elif controller == 'FetchMasterBootStrapStatus':
return cm.FetchMasterBootStrapStatus()
elif controller == 'FetchChildBootStrapStatus':