3 #from time import sleep
5 from datetime import datetime
9 BE_PORT="<%= @be_port %>"
10 PROTOCOL="<%= @protocol %>"
23 ##############################
25 ##############################
27 command="curl -k -s -o /dev/null -I -w \"%{http_code}\" -i "+PROTOCOL+"://" + BE_IP + ":" + BE_PORT + "/sdc2/rest/v1/user/jh0003"
29 proc = subprocess.Popen( command , shell=True , stdout=subprocess.PIPE )
30 (out, err) = proc.communicate()
34 ##############################
36 ##############################
39 myResult = checkBackend()
41 print '[INFO]: Backend is up and running'
45 currentTime = datetime.now()
46 print '[ERROR]: ' + currentTime.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + ' Backend not responding, try #' + str(i) + bcolors.ENDC
50 print '[ERROR]: ' + time.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + 'Backend is DOWN :-(' + bcolors.ENDC