cmk.agent_based.v1.clusterize

make_node_notice_results(node_name, node_check_results, *, force_ok=False)

Prepare results of a node for output in a cluster check function

This function consumes everything from a check function (that is, a Result, a Metric or an IgnoreResults) and returns an iterable of Results.

The text is prepended with ‘[node]: ‘, and the text type is changed from summary to notice (see Result for more details).

Usage example:
>>> def cluster_check_myplugin(item, section):
...     '''A cluster check function that just passes along all node results'''
...     for node_name, node_section in section.items():
...         yield from make_node_notice_results(
...             node_name,
...             check_myplugin(item, node_section),
...         )

This will write text from every node to the services summary if the state is not OK, otherwise to the details text.

Parameters:
  • node_name (str) – The name of the node

  • node_check_results (Iterable[IgnoreResults | Metric | Result]) – The return values or generator of the nodes check_function call

  • force_ok (bool) – If specified, the state of all results is chacnged to OK. In this case the state marker corresponding to the original state is appended to the text.

Return type:

Iterable[Result]

Returns:

The node results, with the text type notice.