3 #from time import sleep
5 from datetime import datetime
9 BE_PORT="<%= @be_port %>"
22 ##############################
24 ##############################
26 command="curl -s -o /dev/null -I -w \"%{http_code}\" -i http://" + BE_IP + ":" + BE_PORT + "/sdc2/rest/v1/user/jh0003"
28 proc = subprocess.Popen( command , shell=True , stdout=subprocess.PIPE )
29 (out, err) = proc.communicate()
33 ##############################
35 ##############################
38 myResult = checkBackend()
40 print '[INFO]: Backend is up and running'
44 currentTime = datetime.now()
45 print '[ERROR]: ' + currentTime.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + ' Backend not responding, try #' + str(i) + bcolors.ENDC
49 print '[ERROR]: ' + time.strftime('%Y/%m/%d %H:%M:%S') + bcolors.FAIL + 'Backend is DOWN :-(' + bcolors.ENDC