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