python-mk-livestatus icon indicating copy to clipboard operation
python-mk-livestatus copied to clipboard

Counts do not work

Open Hinnack opened this issue 8 years ago • 4 comments

I try query 6 from http://mathias-kettner.de/checkmk_livestatus.html GET services Stats: state = 0 Stats: state = 1 Stats: state = 2 Stats: state = 3

like:

from mk_livestatus import Socket
s = Socket(('x.y.z.q', 50000))
q = s.services
q = q.filter('state = 1')
q = q.filter('state = 2')
q = q.filter('state = 3')
q.call()

result is empty array

Hinnack avatar Jul 12 '16 17:07 Hinnack

I think you have to write

from mk_livestatus import Socket
s = Socket(('x.y.z.q', 50000))
q = s.services.filter('state = 1').filter('state = 2').filter('state = 3')
q.call()

ways avatar Apr 26 '18 11:04 ways

I think you have to write

from mk_livestatus import Socket
s = Socket(('x.y.z.q', 50000))
q = s.services.filter('state = 1').filter('state = 2').filter('state = 3')
q.call()

I can't use q.call() right now?

q.call() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/dist-packages/mk_livestatus/livestatus.py", line 25, in call return self._conn.call(data) File "/usr/local/lib/python3.8/dist-packages/mk_livestatus/livestatus.py", line 61, in call s.connect(self.peer) FileNotFoundError: [Errno 2] No such file or directory

phatad avatar Aug 17 '23 12:08 phatad

I think you have to write

from mk_livestatus import Socket
s = Socket(('x.y.z.q', 50000))
q = s.services.filter('state = 1').filter('state = 2').filter('state = 3')
q.call()

I can't use q.call() right now?

q.call() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/dist-packages/mk_livestatus/livestatus.py", line 25, in call return self._conn.call(data) File "/usr/local/lib/python3.8/dist-packages/mk_livestatus/livestatus.py", line 61, in call s.connect(self.peer) FileNotFoundError: [Errno 2] No such file or directory

Sorry, I no longer develop for checkmk and this is 5 years old, so I have no idea. Perhaps the change from 1.6 to 2.0 broke this? :shrug:

ways avatar Aug 17 '23 13:08 ways

I think you have to write

from mk_livestatus import Socket
s = Socket(('x.y.z.q', 50000))
q = s.services.filter('state = 1').filter('state = 2').filter('state = 3')
q.call()

I can't use q.call() right now?

q.call() Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python3.8/dist-packages/mk_livestatus/livestatus.py", line 25, in call return self._conn.call(data) File "/usr/local/lib/python3.8/dist-packages/mk_livestatus/livestatus.py", line 61, in call s.connect(self.peer) FileNotFoundError: [Errno 2] No such file or directory

Sorry, I no longer develop for checkmk and this is 5 years old, so I have no idea. Perhaps the change from 1.6 to 2.0 broke this? 🤷

I installed CMK version 1.6.0p30

phatad avatar Aug 17 '23 16:08 phatad