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

Component Checks & agents
Title Extended Check_MK-API: check function may return None
Date Sep 30, 2014
Level Prominent Change
Class New Feature
Compatibility Compatible - no manual interaction needed
Checkmk versions & editions
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6
Not yet released
Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)
1.2.5i6 Checkmk Raw (CRE), Checkmk Enterprise (CEE), Checkmk MSP (CME)

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.

To the list of all Werks