import time
import json
#from redis.sentinel import Sentinel
import connect

if __name__ == '__main__':
    # ======Try to connect NEON server
  
    ip_port = [('10.1.34.116', 9001), ('10.1.34.116',9001)]
    #ip_port = [('10.1.53.240', 9001), ('10.1.53.240',9001)]
    passwd = 'sanlie;123'

    r= connect.connectNeon(ip_port, passwd, 10)
    r_read = r.getRedisRead()

    path='/SANS/control/command/mantid' 
    path2='/SANS/heartbeat/mantid'
     
    #path='/SANS/control/command/mantid1' 
    #path2='/SANS/heartbeat/mantid1' 
    x=r_read.get(path)
    y=r_read.get(path2)
    print x,y
    #print json.loads(x),json.loads(y)
