{"id":20606798,"url":"https://github.com/jochumdev/lql-api","last_synced_at":"2025-09-26T10:31:28.421Z","repository":{"id":64302304,"uuid":"299662715","full_name":"jochumdev/lql-api","owner":"jochumdev","description":"LQL API Server for check_mk","archived":false,"fork":false,"pushed_at":"2025-01-12T20:17:51.000Z","size":7764,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-12T21:24:56.830Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jochumdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-29T15:42:07.000Z","updated_at":"2025-01-12T20:17:55.000Z","dependencies_parsed_at":"2025-01-12T21:21:07.800Z","dependency_job_id":"620c282c-7004-4b18-8884-29d39c2ddf23","html_url":"https://github.com/jochumdev/lql-api","commit_stats":{"total_commits":53,"total_committers":3,"mean_commits":"17.666666666666668","dds":"0.16981132075471694","last_synced_commit":"ee6bd8aa5dc39fb9a1347d4101f4a1ef6494116c"},"previous_names":["pcdummy/lql-api","webmeisterei/lql-api"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Flql-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Flql-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Flql-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jochumdev%2Flql-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jochumdev","download_url":"https://codeload.github.com/jochumdev/lql-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234304789,"owners_count":18811257,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T09:34:44.402Z","updated_at":"2025-09-26T10:31:28.415Z","avatar_url":"https://github.com/jochumdev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lql-api\n\nLQL-API is an HTTP/S and SSH bridge to the Livestatus socket, it uses the same authentication as check_mk by parsing the site’s Apache Httpasswd.\n\nLook at [the LQL Docs](https://checkmk.com/cms_livestatus.html) to see what LQL can do for you.\n\nLQL-API is typically installed as https://monitor.fdqn.com/“site”/lql-api/\n\nYou can test with the following URL:\n\n```\nhttps://monitor.fqdn.com/\"site\"/lql-api/v1/table/hosts\n```\n\nTo get the column's of the host table:\n\n```\nhttps://monitor.fqdn.com/\"site\"/lql-api/v1/table/columns?filter=Filter%3A+table+=+hosts\u0026column=name\u0026column=description\n```\n\n## Commands the client supports\n\n### localclient - Local LQL Client\n\n```\n$ lql-api localclient -h\nLocal LQL Client\n\nRequires a local lql unix socket.\n\nExamples:\n\n- Fetch first row from the hosts table:\n\n    $ lql-api localclient mysite -t hosts -c name -c address -c groups -l 1\n\n- The same with stdin:\n\n    $ echo -e \"GET hosts\\nColumns: name address groups\\nLimit: 1\" | lql-api localclient mysite\n\n- Fetch the events from the last 5 mins:\n\n    $ echo -e \"GET log\\nColumns: current_host_name current_service_display_name state plugin_output time\\nFilter: time \u003e= $(($(date +%s) - 300))\\nFilter: state \u003e 0\" | lql-api localclient mysite | jq\n\nUsage:\n  lql-api localclient [site] [flags]\n\nFlags:\n  -c, --columns stringArray   Columns to show from the given table, this is required if you give a table!\n  -d, --debug                 Enable Debug on stderr\n  -f, --format string         Format one of: python, python3, json, csv, CSV, jsonparsed (default is jsonparsed, I parse json from the server) (default \"jsonparsed\")\n  -h, --help                  help for localclient\n  -l, --limit int             Limit request lines\n  -s, --socket string         Socket on the Server (default \"/opt/omd/sites/{site}/tmp/run/live\")\n  -t, --table string          Produce a GET request for the given table (default: supply request by stdin)\n  -u, --user string           LQL user to limit this on\n```\n\n### localserver: Local LQL Server\n\n```\n$ lql-api localserver -h\nLocal LQL Server\n\nRequires a local lql unix socket.\n\nUsage:\n  lql-api localserver [site] [flags]\n\nFlags:\n  -d, --debug             Enable Debug on stderr\n  -h, --help              help for localserver\n  -t, --htpasswd string   htpasswd file (default \"/opt/omd/sites/{site}/etc/htpasswd\")\n  -l, --listen string     Address to listen on (default \":8080\")\n  -x, --max-conns int     maximal Client Connections (default 5)\n  -m, --min-conns int     minimal Client Connections (default 2)\n  -s, --socket string     Socket (default \"/opt/omd/sites/{site}/tmp/run/live\")\n```\n\nSee the Installing docs for it.\n\n### sshclient: SSH LQL Client\n\n```\n$ lql-api sshclient -h\nSSH LQL Client\n\nThis version connects to the Check_MK Server by SSH.\n\nIf you don't provide ssh-keyfile and ssh-password it will use your local agent.\n\nExamples:\n\n- Fetch first row from the hosts table:\n\n    $ lql-api sshclient mysite myinternal.host.name -U mysite -t hosts -c name -c address -c groups -l 1\n\n- The same with stdin:\n\n    $ echo -e \"GET hosts\\nColumns: name address groups\\nLimit: 1\" | lql-api sshclient mysite myinternal.host.name -U mysite\n\nUsage:\n  lql-api sshclient [site] [server] [flags]\n\nFlags:\n  -c, --columns stringArray   Columns to show from the given table, this is required if you give a table!\n  -d, --debug                 Enable Debug on stderr\n  -f, --format string         Format one of: python, python3, json, csv, CSV, jsonparsed (default is jsonparsed, I parse json from the server) (default \"jsonparsed\")\n  -h, --help                  help for sshclient\n  -l, --limit int             Limit request lines\n  -s, --socket string         Socket on the Server (default \"/opt/omd/sites/{site}/tmp/run/live\")\n  -k, --ssh-keyfile string    Keyfile (default \"~/.ssh/id_rsa\")\n  -p, --ssh-password string   Password\n  -U, --ssh-user string       SSH User (default \"root\")\n  -t, --table string          Produce a GET request for the given table (default: supply request by stdin)\n  -u, --user string           LQL user to limit this on\n```\n\n### sshserver: SSH LQL Server\n\n```\n$ lql-api sshserver -h\nSSH LQL Server\n\nThis version connects to the Check_MK Server by SSH.\n\nIf you don't provide ssh-keyfile and ssh-password it will use your local agent.\n\nExamples:\n\n- With Debug and a single connection:\n\n    $ lql-api sshserver mysite myinternal.host.name -d -m 1 -x 1 -U mysite\n\n- Without Debug and maximum 5 connections:\n\n    $ lql-api sshserver mysite myinternal.host.name -m 1 -x 5 -U mysite\n\nUsage:\n  lql-api sshserver [site] [server] [flags]\n\nFlags:\n  -d, --debug                 Enable Debug on stderr\n  -h, --help                  help for sshserver\n  -t, --htpasswd string       htpasswd file, default: NO authentication\n  -l, --listen string         Address to listen on (default \":8080\")\n  -x, --max-conns int         maximal Client Connections (default 5)\n  -m, --min-conns int         minimal Client Connections (default 2)\n  -s, --socket string         Socket on the Server (default \"/opt/omd/sites/{site}/tmp/run/live\")\n  -k, --ssh-keyfile string    Keyfile (default \"~/.ssh/id_rsa\")\n  -p, --ssh-password string   Password\n  -U, --ssh-user string       SSH User (default \"root\")\n```\n\n### Version\n\nPrints the version\n\n## OpenAPI 3.0 Support in sshserver and localserver\n\nThis support's OpenAPI 3.0 use the url http://localhost:8080/openapi.json and browse it over an OpenAPI browser.\n\n## Build a debian package\n\nif you use gvm\n\n```bash\ngvm use system; make debian; gvm use go1.15.1\n```\n\nelse\n\n```bash\nmake debian\n```\n\n## Installing the **localserver**\n\nFirst install the package, replace \"site\" with your real site.\n\n```bash\ndpkg -i \u003cpackage\u003e\napt install -f\n```\n\nNext create /etc/lql-api/`site`, with the following contents:\n\n```bash\nLISTEN=\"localhost:8080\"\nARGS=\"\"\n```\n\nNow you can start the lql-api\n\n```bash\nsystemctl enable --now lql-api@\u003csite\u003e\n```\n\nNext create an apache proxy for it in /etc/apache2/conf-available/zzzz_`site`_lql-api.conf\n\n```apache\n\u003cIfModule mod_proxy_http.c\u003e\n  \u003cProxy http://127.0.0.1:8080/\u003e\n    Order allow,deny\n    allow from all\n  \u003c/Proxy\u003e\n\n  \u003cLocation /\u003csite\u003e/lql-api/\u003e\n    ProxyPass http://127.0.0.1:8080/ retry=0 timeout=120\n    ProxyPassReverse http://127.0.0.1:8080/\n  \u003c/Location\u003e\n\u003c/IfModule\u003e\n\n\u003cIfModule !mod_proxy_http.c\u003e\n  Alias /\u003csite\u003e/lql-api/ /omd/sites/\u003csite\u003e\n  \u003cDirectory /omd/sites/\u003csite\u003e/lql-api/\n    Deny from all\n    ErrorDocument 403 \"\u003ch1\u003eCheckmk: Incomplete Apache Installation\u003c/h1\u003eYou need mod_proxy and\n    mod_proxy_http in order to run the web interface of Checkmk.\"\n  \u003c/Directory\u003e\n\u003c/IfModule\u003e\n```\n\n## Development\n\nInstall [chglog](https://github.com/goreleaser/chglog)\n\n```bash\n./release.sh \"fix: ...\" v0.0.16\n```\n\n## License\n\nMIT - Copyright 2024 by [@jochumdev](http://github.com/jochumdev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Flql-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjochumdev%2Flql-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjochumdev%2Flql-api/lists"}