FNDH health model

An implementation of a health model for a FNDH.

class FndhHealthModel(health_changed_callback, logger)

The health model for a FNDH.

The health model will contain a dictionary _state containing data to feed the healthRules. The monitoring_points key maps to a dictionary containing the current attribute values which are checked against the alarm thresholds. The portspowersensed attribute is used to determine if the smartbox on the attached port is controllable.

Example:
>>> {
>>>     "pasd_power": PowerState.ON
>>>     "ignore_pasd_power": False
>>>     "ports_with_smartbox": [1, 3, 4, 6]
>>>     "status": "OK",
>>>     "monitoring_points" :{
>>>         "portspowercontrol" : [True] * 28,
>>>         "portspowersensed"  : [True] * 28,
>>>         ...
>>>     }
>>> }
__init__(health_changed_callback, logger)

Initialise a new instance.

Parameters:
  • logger (Logger) – the logger to use.

  • health_changed_callback (HealthChangedCallbackProtocol) – callback to be called whenever there is a change to this this health model’s evaluated health state.

evaluate_health()

Compute overall health of the fndh.

The overall health is determined by a set of monitoring points defined in the _state dictionary.

Example:
>>> {
>>>     "pasd_power": PowerState.ON
>>>     "ignore_pasd_power": False
>>>     "ports_with_smartbox": [1, 3, 4, 6]
>>>     "monitoring_points" :{
>>>         "portspowercontrol" : [True] * 28,
>>>         "portspowersensed"  : [True] * 28,
>>>         ...
>>>     }
>>> }

For more details see FndhHealthRules.

Return type:

tuple[HealthState, str]

Returns:

an overall health of the FNDH.

property health_params: dict[str, Any]

Get the thresholds for health rules.

Returns:

the thresholds for health rules

property health_rule_active: bool

A flag to represent if new healthRules are active.

Returns:

True if the new health rule is active.

property monitoring_points_health_status: dict[str, tuple[ska_control_model.HealthState, str]]

Return a dictionary containing health information about monitoring points.

For monitoring points with a threshold defined evaluates the health of and add to a dictionary.

Returns:

health information about monitoring points.

update_monitoring_point_threshold(monitoring_point, threshold_values)

Update the monitoring point threshold.

Parameters:
  • monitoring_point (str) – the name of this monitoring point.

  • threshold_values (ndarray) – a list of 4 values containing high_alm, high_warn, low_warn, low_alm

Return type:

None