We use cookies to ensure that we give you the best experience on our website.  Visit our Privacy Policy to learn more. If you continue to use this site, we will assume that you are okay with it.

Your choices regarding cookies on this site.
Your preferences have been updated.
In order for the changes to take effect completely please clear your browser cookies and cache. Then reload the page.

The New Check API

Checkmk Manual

Search in the manual

This is the old documentation.
You can find the shiny new documentation here, which is replacing over time this one.
Thus, this article is obsolete and may be not valid anymore - however, the new one is not finished yet!

1. The New Check API

As you have learned in previous articles, a check must be declared to Checkmk. In the old times this had be done with a line like this:

check_info["uptime"] = (check_uptime, "Uptime", 1, inventory_uptime)

As of version 1.2.0 Checkmk offers an alternative dictionary based declaration:

check_info["uptime"] = {
    "inventory_function"  : inventory_uptime,
    "check_function"      : check_uptime,
    "has_perfdata"        : True,
    "service_description" : "Uptime",

This new style has the advantage that it also covers further keys that had been kept in special variables, which now become obsolete. Here is a more complex example (from the df check):

check_info['df'] = {
    "check_function"          : check_df,
    "inventory_function"      : inventory_df,
    "service_description"     : "fs_%s",
    "has_perfdata"            : True,
    "group"                   : "filesystem",
    "default_levels_variable" : "filesystem_default_levels",
    "includes"                : [ "df.include" ],

2. Available Parameters for check_info[mycheck]

The following table lists all possible keys in the new dictionary-type declaration. The only mandatory parameters are check_function and service_description:

check_functionThe check function (like first parameter in old-style declaration)
inventory_functionThe inventory function (forth parameter in old-style declaration)
service_descriptionThe service description for Nagios (second parameter)
has_perfdataTrue if the check sends performance data, False or missing if otherwise (replaces the 0 and 0 of the old-style third paramter).
groupWATO configuration group for this check (formerly checkgroup_of[...])
default_levels_variableName (not value!) of the variable that the user can define in main.mk in order to define default levels. This works only for dictionary based parameters (formerly check_default_levels[...]).
includesA list of files this check needs to include (formerly check_includes[...])
snmp_infoSNMP OID configuration for SNMP checks (formerly snmp_info[...])
snmp_scan_functionSNMP scan function for SNMP checks (formerly snmp_scan_functions[...])
parse_functionA function who should parse all information before passing it to the check or inventory function