Checkmk / checkmk-docs

Checkmk user manual
https://docs.checkmk.com
29 stars 129 forks source link

Using LQL in Python example not working: TypeError: a bytes-like object is required, not 'str #60

Closed t29j closed 1 year ago

t29j commented 1 year ago

Hello,

The example in section 2.2. Using LQL in Python is not working https://docs.checkmk.com/latest/en/livestatus.html#heading__using_lql_in_python

OMD[central]:~$ python3 live_example.py 
Traceback (most recent call last):
  File "/opt/omd/sites/central/live_example.py", line 17, in <module>
    sock.sendall("GET status\nOutputFormat: json\n")
TypeError: a bytes-like object is required, not 'str'

Would be nice if there would be a functional code snipped.

sebkir commented 1 year ago

Fixed with commit 5a8c233c78e2d5013458881b15fd73ee77fe07a9