Refactoring: Moved more application check parameters from unsorted.py to dedicated...
[check_mk.git] / .werks / 1409
blobd6ed9022e3756b6a112dada24c8c7eb5fbc4c286
1 Title: Extended Check_MK-API: check function may return None
2 Level: 2
3 Component: checks
4 Compatible: compat
5 Version: 1.2.5i6
6 Date: 1412058117
7 Class: feature
9 A check function may now return <tt>None</tt> (or simply end without
10 returning anything). This will no longer create an exception but return
11 state <tt>UNKNOWN</tt> and - depending on the type of the check -
12 one of the following outputs:
14 <tt>Item not found in SNMP data</tt>
16 <tt>Item not found in agent output</tt>
18 This means that for the typical check that loops through the agent
19 output looking for its item now does not need to manually do a
21 C+:
22     return 3, "Something not found in agent output"
23 C-:
25 anymore. This is now the default case. This has several advantages:
27 <ul>
28 <li>You save some code in the check implementation.</li>
29 <li>The output of the various checks is unified.</li>
30 <li>A future Check_MK version can easily have a rule for changing the state
31 in such cases from UNKNOWN to WARN or CRIT.</li>
32 </ul>