Device Health

The best introduction to health in mccs is to consider the set of problems it solves:

  1. Maintainers need to be able to diagnose and identify software/hardware problems as early as possible.

  2. Users need a simple and intuitive feature that can indicate what observations a telescope can do in the moment.

Given the architecture of the software, and the way software and hardware interact, the system we use to monitor the devices must do 2 things:

  1. Self-diagnose: it has to interpret various measurements (like temperature, current, voltage, fan speeds, etc) into a health state for that device (for example, if a subrack notices the voltage input for the power supply drops too far, it should indicate this by changing the health state and logging the cause)

  2. Health needs to “roll up”: tango devices that manage other devices (spsstation oversees the subrack and tiles, station oversees the spsstation and the fieldstation, etc) must be able to interpret the health state of its subdevices and aggregate those into its own health state.

To achieve these two points, each device has a health attribute that returns an Enum state representing its health state:

  • OK (0): A device reports this state when there are no failures that are assessed as affecting the ability of the device to perform its function.

  • DEGRADED (1): The device reports this state when only part of its functionality is available.

  • FAILED (2): The device reports this state when unable to perform core functionality and produce valid output.

  • UNKNOWN (3): The device reports this state when unable to determine its health. This is also an initial state, indicating that health state has not yet been determined

More information can be found at https://developer.skao.int/projects/ska-control-model/en/latest/health_state.html.

Monitoring points

The first point is currently accomplished by the attribute thresholds. Tango devices that interact with hardware (tile, subrack, etc) often have a set of attributes representing sensor measurements from the physical device they communicate with. For most of these values, we get a range of acceptable thresholds from the manufacturer. The role of health thresholds in MCCS is to notify the operators of physical defects.

The measured values reported by subdevices are called “Monitoring Points”. Each monitoring point is exposed to the users (or other Tango devices) as a Tango Attribute.

The monitoring points are set on the Tango Attribute itself, and there are two pairs of thresholds: one pair for the early warning values, another pair for the alarm values. Each pair has a minimum and maximum value. I should mention that not all monitoring points have all 4 of the points, and this varies for each device.

Health Rollup

MCCS devices work in a hierarchical structure; as such, some devices have to monitor and report the state of their subdevices (note: subdevices don’t have anything special about them, other than the fact that they are usually only interacted with by other devices).

If every device had only one subdevice, the health roll up would be fairly straightforward and simple: inherit the health from the subdevice. However, devices often have multiple subdevices and even different types of subdevices, and sometimes their own monitoring points as well.

The health rollup mechanism was added to manage this. The core logic behind it is fairly straightforward: each Tango device has a set of health thresholds (not to be confused with the attribute thresholds) for each type of health source. A health source can be a type of subdevice, the device’s own monitoring point or another factor. Each health source is stored in a dictionary where it is represented by a key, tuple pair. The key is simply the name of the device, while the tuple is of the form:

(failed_threshold, failed_degraded_threshold, degraded_threshold)

Where:

  1. failed_threshold: Number of FAILED (or UNKNOWN) subdevices that cause the overall health to become FAILED

  2. failed_degraded_threshold: Number of FAILED (or UNKNOWN) subdevices that cause the overall health to become DEGRADED

  3. degraded_threshold: Number of DEGRADED subdevices that cause the overall health to become DEGRADED

This is a simple overview of the threshold mechanism and more information on how these values determine the health of a device can be found in Health Thresholds.

Note

This mechanism can also be used to change the health state based on other factors. For example, SpsStation needs the Tiles it oversees to be in the correct Programming state to be able to run observations. As such, this state is also set up as a health source.

Station’s HealthRollup

How MccsStation’s health sources feed into its HealthRollup.

../../_images/mccs_station_rollup.png

The fault trees below show which conditions actually drive the station to DEGRADED versus FAILED. Note that self currently has no MccsStation-specific health logic of its own, so it can only ever be OK or UNKNOWN — it therefore only appears in the FAILED tree:

../../_images/mccs_station_degraded.png

Conditions that degrade an MccsStation.

../../_images/mccs_station_failed.png

Conditions that fail an MccsStation.

fieldstation and spsstation are each a single subdevice, so their contribution is simply that subdevice’s own HealthState. Diagrams linked at the end of the page.

Controller’s HealthRollup

../../_images/controller_health_rollup.png

How MccsController’s named health sources feed into its HealthRollup.

As with MccsStation, self currently has no MccsController-specific health logic: it goes OK once communication with the controller’s own component is established at startup, and no code path ever changes it after that — it only appears in the FAILED tree, for the brief UNKNOWN window before that happens.

../../_images/controller_health_degraded.png

Conditions that degrade an MccsController.

../../_images/controller_health_failed.png

Conditions that fail an MccsController.

Note the asymmetry between DEGRADED and FAILED here: subarrays, subarraybeams and stationbeams all use a (0, 1, 1) threshold, and stations uses (0, max(5% of N, 1), max(5% of N, 2)) — in both cases the leading 0 means all members of that group must fail before the group itself is considered FAILED (see the zero-value semantics in Health Thresholds), while a single non-OK member is already enough to DEGRADE it. So the controller is comparatively easy to degrade but hard to fail via any one subordinate group.

Other Devices

Mccs is separated across a few different repos based on subsystems. Some Tango devices that have a health state are found in their respective repos, and as such, they are documented in their own RtD. Here is a list of the devices and links to their own documentation: