{% extends "template.html" %} {% block title %}Index{% endblock %} {% block head %} {{ super() }} {% endblock %} {% block content %}
Livestatus-service exposes the functionality of a livestatus socket to the outside world over HTTP.
GET /query?q=QUERY
Will perform a query using QUERY.
Example : /query?q=GET%20hosts
If you need newlines, e.G. to add a filter, use \n
.
Example : query notifications_enabled for host devica01.
See the LQL documentation for more information.
By default you will receive a list of dictionaries, where each dictionary represent a row.
Example : host_name and notifications_enabled
The example yields
[{ "notifications_enabled": "0", "host_name": "devica01" }, { "notifications_enabled": "1", "host_name": "tuvdbs05" }, { "notifications_enabled": "1", "host_name": "tuvdbs06" }, { "notifications_enabled": "1", "host_name": "tuvdbs50" }, { "notifications_enabled": "1", "host_name": "tuvmpc01" }, { "notifications_enabled": "1", "host_name": "tuvmpc02" }, { "notifications_enabled": "1", "host_name": "tuvrep01" }]
If you specify the key
parameter, this column name will be used as a unique index for the rows and you will have a dictionary of dictionaries instead.
Example : host_name and notifications_enabled with host_name as key
The example yields
{ "devica01": { "notifications_enabled": "0", "host_name": "devica01" }, "tuvrep01": { "notifications_enabled": "1", "host_name": "tuvrep01" }, "tuvdbs06": { "notifications_enabled": "1", "host_name": "tuvdbs06" }, "tuvdbs05": { "notifications_enabled": "1", "host_name": "tuvdbs05" }, "tuvdbs50": { "notifications_enabled": "1", "host_name": "tuvdbs50" }, "tuvmpc01": { "notifications_enabled": "1", "host_name": "tuvmpc01" }, "tuvmpc02": { "notifications_enabled": "1", "host_name": "tuvmpc02" } }
GET /cmd?q=COMMAND
Will perform a command using COMMAND.
The COMMAND [%s]
directive will be inserted for you.
Example : /cmd?q=ENABLE_HOST_NOTIFICATIONS;devica01
Refer to the list of external commands for more information.
handler
argument to use a custom handler.
Handler | Effect |
---|---|
livestatus (default) | Uses the livestatus UNIX socket |
icinga | Uses the configured icinga command file (commands only) |