blob: 8d9c8ae68783c1784fc3d4291ad4464f95d65aca [file] [log] [blame]
Ed Tanous9b243a42018-08-03 14:33:10 -07001import 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()