Werk #1409: Extended Check_MK-API: check function may return None

Komponente Checks & agents
Titel Extended Check_MK-API: check function may return None
Datum 30.09.2014
Checkmk Edition Checkmk Raw (CRE)
Checkmk-Version 1.2.5i6
Level Bedeutende Änderung
Klasse Neues Feature
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen

A check function may now return None (or simply end without returning anything). This will no longer create an exception but return state UNKNOWN and - depending on the type of the check - one of the following outputs:

Item not found in SNMP data

Item not found in agent output

This means that for the typical check that loops through the agent output looking for its item now does not need to manually do a

    return 3, "Something not found in agent output"

anymore. This is now the default case. This has several advantages:

  • You save some code in the check implementation.
  • The output of the various checks is unified.
  • A future Check_MK version can easily have a rule for changing the state in such cases from UNKNOWN to WARN or CRIT.

Zur Liste aller Werks