Checkmk
to checkmk.com

1. Available tables

The following tables are available for use in Livestatus. Some of them additionally function over the columns of another table. These columns will be identified by the table’s name as a prefix:

Table Comments

hosts

Contains all information for the configured hosts.

services

Contains all information for the configured services, and additionally the columns from hosts.

hostgroups

Information for the host groups.

servicegroups

Information for the service groups.

contactgroups

Information for the contact groups.

servicesbygroup

As for services, but additionally with the columns from servicegroups.

servicesbyhostgroup

Like services, but additionally with the columns from hostgroups.

hostsbygroup

Like hosts, but additionally with the columns from hostgroups.

contacts

Information for the contacts.

commands

All configured check commands, as found for a service under Service check command.

timeperiods

All information for the configured time periods.

downtimes

As for timeperiods, but for scheduled downtimes.

comments

Contains all information for comments, and in addition the columns from hosts and services.

log

All information for logged events. These should be filtered by class and time stamp/time period.

status

Information for the core’s status and performance.

columns

All available tables will be listed here. Additionally, a description of all of a table’s columns is also provided.

statehist

The past-statuses for a host/service can be comprehensively searched with this table.

eventconsoleevents

Lists all of the Event Console's events. This table additionally has all columns from hosts.

eventconsolehistory

Like eventconsoleevents, but also with additional columns for an event’s history.

eventconsolestatus

Lists statistics from the performance of the Event Console.

eventconsolerules

Statistics for how often the rule-matching for an incoming event was successful.

Should you wish to know which columns a table uses, these can be easily shown with the following command:

OMD[mysite]:~$ lq "GET columns\nColumns: name\nFilter: table = columns"
description
name
table
type

Other tables can also be selected by using filters. All of the columns available for searching by column and table can be seen in the output from the example shown.

2. Available headers

Header Argument Function

Columns

Column name

Restricts the output to the specified columns.

Filter

Column name, operator and object name

Restricts the output to the defined object. See also filter.

OR

Integer

Links the last n filter(s) with a logical OR.

AND

Integer

Links the last n filter(s) with a logical AND.

NEGATE

Integer

Inverts the last n filter(s).

Separators

ASCII-values

Defines the characters for separating elements.

OutputFormat

Name

Defines an alternative output format for the data. Possible formats are json, python, python3, CSV and csv (the standard format).

Stats

Operator and column names

Generates statistics for specified columns.

StatsOr

Integer

Provides the OR-header’s functions in the statistics.

StatsAnd

Integer

Provides the AND-header’s functions in the statistics.

StatsNegate

Integer

Provides the NEGATE-header’s functions in the statistics.

Limit

Integer

Limits the output to n lines.

Timelimit

Integer

Restricts the time allowed for processing the query to n seconds.

ColumnHeaders

-

The first line of the output contains the name of the column used. If the header ResponseHeader has additionally been set, the column name will be output in the second line.

AuthUser

User Name

Restricts the output to the lines that the specified user is authorized to see.

WaitObject

Object Name

The object for which a specified behavior is expected. This is the object’s name, or respectively in the case of the services table, the host’s name followed by a blank character, followed in turn by the service description. If the host name itself contains blank characters the two elements can also be separated by a semicolon. This header is only supported by the hosts, services hostgroups servicegroups contacts and contactgroups tables.

WaitCondition

Filter condition

The condition that must be satisfied for the defined object. Any desired number of conditions can be defined – these are linked together with a logical AND.

WaitConditionOr

Integer

Provides the OR-header function in the Wait-conditions.

WaitConditionAnd

Integer

Provides the AND-header function in the Wait-conditions.

WaitConditionNegate

Integer

Provides the NEGATE-header function in the Wait-conditions.

WaitTrigger

Keyword *

Keywords work like a normal condition if they are set by themselves. In combination with the WaitCondition this simplifies the locating of relevant log entries and reduces the overhead in Livestatus.

WaitTimeout

Integer

Sets a time limit in milliseconds. Following, for example, 5000 Milliseconds (5 seconds), the query will be executed even if the condition has not been satisfied.

Localtime

Unix Time

By using a specified reference time it is attempted to compensate for differing local time stamps in a distributed environment.

ResponseHeader

fixed16/off

Returns a status line in the first line of the response. The output itself remains in the first line if the header ColumnHeaders has additionally been set.

KeepAlive

on

Prevents the Livestatus-channel being closed following a query.

* The following keywords are available for the WaitTrigger:

  • check

  • state

  • log

  • downtime

  • comment

  • command

  • program

  • all

3. Operators for filters

3.1. General operators

Operator * For numbers For character strings

=

Equality

Equality

~

Superset **

Contains a character string as a regular expression.

=~

Subset **

Case-insensitive equality

~~

Contains at least one of the values **

Contains a case-insensitive character string as a regular expression.

<

Smaller than

Lexicographically smaller than

>

Larger than

Lexicographically larger than

<=

Smaller or equal

Lexicographically smaller or equal

>=

Larger or equal

Lexicographically larger or equal

* All operators can be negated with an exclamation mark (!).

** These operators are useful when working with lists. Livestatus then interprets the specified values as a quantity.

3.2. Operators for lists

You can check whether an element is included in a list using the following operators:

Operator Type of check

=

Checks for empty lists *

>=

Equality

<

Disparity

<=

Case-insensitive equality

>

Case-insensitive disparity

~

The character string for a regular expression *

~~

The case-insensitive character string for a regular expression *

* These operators can be negated with an exclamation mark (!).

4. Operators for statistics

Operator Description

sum

Generates a sum from the values.

min

Searches for the smallest value.

max

Searches for the highest value.

avg

Calculates an average value (mean value).

std

Outputs the standard deviation.

suminv

Inverts the sum of the values according to 1/sum.

avginv

Inverts the mean value of the values according to 1/avg.

5. Status codes from the ResponseHeader

Status code Description

200

The query was successful and the response contains the requested data.

400

The query contains a faulty header.

404

The table could not be found.

413

The time limit for the query has been exceeded.

451

The query was incompletely transferred.

452

The query is completely invalid.

6. Commands

The following commands are available for you in all Checkmk editions:

Command Description

Host commands

ACKNOWLEDGE_HOST_PROBLEM

Acknowledge a host problem

REMOVE_HOST_ACKNOWLEDGEMENT

Delete a host problem acknowledgement

ADD_HOST_COMMENT

Add a comment to a host

DEL_HOST_COMMENT

Delete a comment from a host

SCHEDULE_HOST_DOWNTIME

Schedule a downtime for a host

DEL_HOST_DOWNTIME

Delete a downtime for a host

START_EXECUTING_HOST_CHECKS

Start the global execution of host checks

STOP_EXECUTING_HOST_CHECKS

Stop the global execution of host checks

ENABLE_HOST_CHECK

Enable active checks for a host

DISABLE_HOST_CHECK

Disable active checks for a host

ENABLE_PASSIVE_HOST_CHECKS

Enable passive host checks for a host

DISABLE_PASSIVE_HOST_CHECKS

Disable passive host checks for a host

ENABLE_HOST_NOTIFICATIONS

Enable notifications for a host

DISABLE_HOST_NOTIFICATIONS

Disable notifications for a host

ENABLE_HOST_SVC_NOTIFICATIONS

Enable notifications for all services of a host

DISABLE_HOST_SVC_NOTIFICATIONS

Disable notifications for all services of a host

SCHEDULE_FORCED_HOST_CHECK

Schedule a forced update of a host check

PROCESS_HOST_CHECK_RESULT

Set the result from a host check manually

SEND_CUSTOM_HOST_NOTIFICATION

Create a custom host notification

CHANGE_HOST_MODATTR

Edit the modified attributes of a host

Service commands

ACKNOWLEDGE_SVC_PROBLEM

Acknowledge a service problem

REMOVE_SVC_ACKNOWLEDGEMENT

Delete a service problem acknowledgement

ADD_SVC_COMMENT

Add a comment to a service

DEL_SVC_COMMENT

Delete a comment from a service

SCHEDULE_SVC_DOWNTIME

Schedule a downtime for a service

DEL_SVC_DOWNTIME

Delete a downtime for a service

START_EXECUTING_SVC_CHECKS

Start the global execution of active services

STOP_EXECUTING_SVC_CHECKS

Stop the global execution of active services

ENABLE_SVC_CHECK

Enable execution of an active service

DISABLE_SVC_CHECK

Disable execution of an active service

ENABLE_PASSIVE_SVC_CHECKS

Enable execution for a passive service

DISABLE_PASSIVE_SVC_CHECKS

Disable execution for a passive service

ENABLE_SVC_NOTIFICATIONS

Enable notifications for a service

DISABLE_SVC_NOTIFICATIONS

Disable notifications for a service

SCHEDULE_FORCED_SVC_CHECK

Schedule a forced update of a service

PROCESS_SERVICE_CHECK_RESULT

Set the result from a passive service manually

SEND_CUSTOM_SVC_NOTIFICATION

Create a custom service notification

CHANGE_SVC_MODATTR

Edit the modified attributes of a service

Other commands

ENABLE_NOTIFICATIONS

Enable notifications globally

DISABLE_NOTIFICATIONS

Disable notifications globally

ENABLE_FLAP_DETECTION

Enable the detection of flapping hosts/services globally

DISABLE_FLAP_DETECTION

Disable the detection of flapping hosts/services globally

ENABLE_PERFORMANCE_DATA

Enable the processing of performance data globally

DISABLE_PERFORMANCE_DATA

Disable the processing of performance data globally

ENABLE_EVENT_HANDLERS

Enable the execution of alert handlers/event handlers globally

DISABLE_EVENT_HANDLERS

Disable the execution of alert handlers/event handlers globally

SAVE_STATE_INFORMATION

Save all status information immediately

Commands which are only available with the CMC in the commercial editions:

Command Description

Host commands

PROCESS_HOST_PERFDATA

tba

UPDATE_SHADOW_HOST_STATE

tba

Service commands

PROCESS_SVC_PERFDATA

tba

UPDATE_SHADOW_SERVICE_STATE

tba

Other commands

LOG

tba

MK_LOGWATCH_ACKNOWLEDGE

tba

RELOAD_CONFIG

tba

REOPEN_DAEMONLOG

tba

ROTATE_LOGFILE

tba

SEGFAULT

tba

On this page