New lql api Server/Client

I’m writing an lql api Server/Client for Check_MK its available on Github. I do that because I haven’t found a proper solution to get all data from /mysite/check_mk/views.py.

lql-api supports connection’s to the socket over ssh and locally, for both versions there is a client (a simple replacement for lql and lql over ssh with some parsing).

It’s written in Go (also named golang) and the server supports OpenAPI 3.0.

Both the “localserver” and the “sshserver” expose the same endpoints,
you can view them when you run “sshserver” and point an OpenAPI browser for example the swagger petstore to http://localhost:8080/openapi.json

A yes both support Basic auth with a .htpasswd, where the sshserver automatically picks the one from wato.

I realy want lql-api to be part of omd, this would require the omd apache to be recompiled with mod_proxy_http.

Please let me know, if you find bugs/have improvements.

Kind regards,

René from Austria

P.s.: once I discovered the forum I found out that the CheckMK Team works on an API, I’ll still work on this as the official API is far from being complete yet.

2 Likes

Why do you think you cannot get all data from the Multisite views.py API?

If there are columns missing in views you just add them or create your own views to export specific columns.

1 Like

@r.sander
Thirst, thanks for your reply!

I’m writing an iOS/Android App for CheckMK and it was hard for me to catch all required data (like the tactical_overview data) from views.py. Maybe I should have looked longer.

But also I don’t want to have users to create Views for my App, so I need a proper API.

Last but not least my API supports none Automation users, which is I think important.

You can now load github.json in the OpenAPI viewer.

I’ve added support for Multisite (all Sockets in /opt/omd/sites/{site}/tmp/run/liveproxy/) and secretly fixed a Deadlock when exiting the App.

Download here: https://github.com/webmeisterei/lql-api/releases

Support to let admin’s see everything will come soon.

Kind regards,

René from Austria

Release v0.0.11-alpha

Changelog:

  • Detect if a user is Admin and do not send AuthUser, this is done by parsing the wato/users.mk with python, the users.mk will be watched by inotify for changes.

Download as always on Github releases.

1 Like

I just released v0.0.12-beta, it adds support for “And/Or/Negate” Filters.

Changelog:

  • Add hosts_* filter, change service_* filter
  • Smaller changes to the buildsystem
  • Allow more filter specific keys in v1/table/* queries
  • Support and/or/negate filters

Download as always on Github releases.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.