1import json 2import ssl 3import websocket 4 5websocket.enableTrace(True) 6 7ws = websocket.create_connection('wss://10.243.48.93:18080/subscribe', 8 sslopt={"cert_reqs": ssl.CERT_NONE}, 9 cookie="XSRF-TOKEN=m0KhYNbxFmUEI4Sr1I22; SESSION=0mdwzoQy3gggQxW3vrEw") 10request = json.dumps({ 11 "paths": ["/xyz/openbmc_project/logging", "/xyz/openbmc_project/sensors"], 12 "interfaces": ["xyz.openbmc_project.Logging.Entry", "xyz.openbmc_project.Sensor.Value"] 13}) 14 15ws.send(request) 16print("Sent") 17print("Receiving...") 18while True: 19 result = ws.recv() 20 print("Received '%s'" % result) 21ws.close() 22