Plugin APIs
This is the plugin API reference from Checkmk. This can help you to get exact information about the API. If you want to know how to use the API, please have a look at the articles about extending Checkmk in our user guide.
Plugin location and loading
Most of the plugin APIs (Agent based, Ruleset, Server-side calls and Graphing API) share the same logic when it comes to location and loading of the plugins. This section will cover those APIs. The Bakery API has a different logic for now, but will be adapted in the future versions.
The shipped plugins are located under the cmk/plugins folder, while local third party plugins are placed under the local/lib/python3/cmk_addons/plugins folder in the site.
As a general rule, code should reside below cmk if and only if it is supplied by Checkmk (but that’s not always the case yet).
Below the top-level folder, plugins are organized in families, e.g. all plugins concerning cisco devices will be found under the folder named cisco.
Plugins belonging to the same family can share code, regardless of the plugin group.
For example a server-side call plugin can share code with the agent based plugins if they belong to the same family.
Below the family folder, plugins are categorized into plugin groups:
server-side calls are located under the
server_side_callsfolderrulesets under the
rulesetsfolderagent based plugins under the
agent_basedfoldergraphing plugins under the
graphingfolderman pages are found in
checkmanexecutables (to be run by the code, for instance) go into
libexec
In order for Checkmk to load your plugin, you have to follow the folder structure described above.
Checkmk will load an agent based plugin only if it’s located under cmk/plugins/{family_name}/agent_based or cmk_addons/plugins/{family_name}/agent_based folder.
Apart from the right location, it’s also important to name the variable of a plugin object with the right prefix.
An agent based plugin is created by instantiating the CheckPlugin object and naming the variable with a check_plugin_ prefix, for example check_plugin_aws_status.
Each plugin expects a different prefix in the variable name:
SNMP sections expect the
snmp_section_prefixagent sections the
agent_section_prefixcheck plugins the
check_plugin_prefixinventory plugins the
inventory_plugin_prefixactive checks the
active_check_prefixspecial agents the
special_agent_prefixrule specs the
rule_spec_prefixmetrics the
metric_prefixtranslations the
translation_prefixperfometers the
perfometer_prefixgraphs the
graph_prefix
- Agent based (“Check API”)
- Version 2
- cmk.agent_based.v2
- New in this version
entry_point_prefixes()AgentSectionCheckPluginSNMPSectionSimpleSNMPSectionSNMPDetectSpecificationInventoryPluginall_of()any_of()exists()equals()startswith()endswith()contains()matches()not_exists()not_equals()not_contains()not_endswith()not_matches()not_startswith()Attributescheck_levels()get_average()get_rate()get_value_store()HostLabelIgnoreResultsIgnoreResultsErrorMetricOIDBytesOIDCachedOIDEndResultRuleSetTypeServiceServiceLabelSNMPTreeStateTableRowGetRateError
- cmk.agent_based.v2.clusterize
- cmk.agent_based.v2.render
- cmk.agent_based.v2
- Version 1 (Checkmk 2.2.0 - 2.3.0)
- cmk.agent_based.v1
all_of()any_of()exists()equals()startswith()endswith()contains()matches()not_exists()not_equals()not_contains()not_endswith()not_matches()not_startswith()Attributescheck_levels()check_levels_predictive()get_average()get_rate()get_value_store()HostLabelIgnoreResultsIgnoreResultsErrorMetricOIDBytesOIDCachedOIDEndregex()ResultServiceServiceLabelSNMPTreeStateTableRowGetRateError
- cmk.agent_based.v1.clusterize
- cmk.agent_based.v1.register
- cmk.agent_based.v1.render
- cmk.agent_based.v1.type_defs
- cmk.agent_based.v1
- Version 2
- Bakery
- Dynamic configuration connector
- Graphing
- Rulesets
- Version 1
- rulesets.v1
- rulesets.v1.rule_specs
- rulesets.v1.form_specs
FormSpecDefaultValueInputHint- Atomic Form Specifications
- Levels Form Specifications
- Composite Form Specifications
- Form Specifications for preconfigured entities
- Validators for Form Specifications
- Migrations for Form Specifications
- Version 1
- Server-side calls