Read the health

This page documents an earlier firmware release. Read this page for the latest release

The Health service in blickfeld_qb2.diagnostics.services returns the health state of the sensor, aggregated over every software module, on the leader of a swarm over every device of the swarm. The WebGUI shows it under System > Diagnostics. The examples use the Python library and sign in with an application key. Replace qb2-xxxxxxxxx with the hostname or IP address of your sensor and application-key-for-qb2-xxxxxxxxx with the secret of your key.

Get the health

The method get returns the current health state.

import blickfeld_qb2

token_factory = blickfeld_qb2.TokenFactory(application_key_secret="application-key-for-qb2-xxxxxxxxx")

# Open a secure and authenticated connection to the sensor
with blickfeld_qb2.Channel(fqdn_or_ip="qb2-xxxxxxxxx", token=token_factory) as channel:
    service = blickfeld_qb2.diagnostics.services.Health(channel)

    response = service.get()
    print(response)

Output, one field per line, with the numbers of state defined in Health:

HealthGetResponse(
    health=Health(
        state=2,
        state_reason='Core Processing: The device could be covered as the point rate is too low',
        module=HealthModule(
            laser=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 13, 7, 59, 11, 391000, tzinfo=datetime.timezone.utc)
            ),
            detector=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 928000, tzinfo=datetime.timezone.utc)
            ),
            beam_deflection_control_vertical=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 612000, tzinfo=datetime.timezone.utc)
            ),
            beam_deflection_control_horizontal=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 801000, tzinfo=datetime.timezone.utc)
            ),
            system=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 454000, tzinfo=datetime.timezone.utc)
            ),
            core_processing=HealthModuleHealth(
                state=2,
                state_reason='The device could be covered as the point rate is too low',
                state_since=datetime.datetime(2026, 11, 13, 8, 16, 11, 939000, tzinfo=datetime.timezone.utc),
                error_flags=['point_rate_too_low']
            ),
            percept_pipeline=HealthModuleHealth(
                state=1,
                state_reason='Not active. Request data stream or configure push to enable pipeline.',
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 831000, tzinfo=datetime.timezone.utc)
            ),
            push=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 553000, tzinfo=datetime.timezone.utc)
            ),
            secure=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 553000, tzinfo=datetime.timezone.utc)
            ),
            video=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 554000, tzinfo=datetime.timezone.utc)
            ),
            compute_module=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 44, 666000, tzinfo=datetime.timezone.utc)
            ),
            onvif=HealthModuleHealth(
                state=1,
                state_since=datetime.datetime(2026, 11, 12, 13, 14, 52, 556000, tzinfo=datetime.timezone.utc)
            )
        ),
        incidents=[
            HealthIncident(
                device='ABC123XYZ',
                module='core_processing',
                state=2,
                state_reason='The device could be covered as the point rate is too low',
                start=datetime.datetime(2026, 11, 13, 8, 16, 11, 939000, tzinfo=datetime.timezone.utc),
                error_flags=['point_rate_too_low']
            )
        ]
    )
)

Watch the health

The method watch streams a health message at regular intervals. The example prints the state of each and stops after three messages.

import blickfeld_qb2

token_factory = blickfeld_qb2.TokenFactory(application_key_secret="application-key-for-qb2-xxxxxxxxx")

# Open a secure and authenticated connection to the sensor
with blickfeld_qb2.Channel(fqdn_or_ip="qb2-xxxxxxxxx", token=token_factory) as channel:
    service = blickfeld_qb2.diagnostics.services.Health(channel)

    for i, response in enumerate(service.watch()):
        # Print the state of the sensor and why it is not OK
        print(response.health.state, response.health.state_reason)
        if i == 2:
            break

Output:

1
1
1

Read the fields of the health

Each module in module of the health message carries, besides state and state_reason:

  • state_since: since when the module is OK, or since when it is not OK.

  • error_flags: the error flags of the module that are set, only while it is not OK. They are a message with a boolean field per flag, grouped by module, for example percept_pipeline.data_loss; the health message of each module documents its flags.

  • ignored: the state is ignored as configured, and neither changes the aggregated state nor causes an incident.

The health of the device carries:

  • incidents: the modules that fail or have a warning, and not because of another module, the worst first. Each lists in affected_modules the modules that are not OK because of it, the nearest first. The cause can also be device (a follower that does not answer), hardware (the service of the laser, the detector and both mirrors) or self_test.

  • device: on the leader of a swarm only, the health of every device of the swarm by serial number, the leader included. A follower that does not answer is STATE_FAILED with the error flag device_unreachable.

  • error_flags: the error flags of the device as a whole, for example self_test_running or device_shutting_down.

A module that is starting or stopping is STATE_BUSY, with the error flag module_starting or module_stopping; one whose software does not run is STATE_FAILED with module_not_running.

Ignore a known condition

The methods set_config and get_config of the Health service hold the rules in ignores. A rule names the module, the error_flags it covers, set to true (none: every condition of the module), the worst state it covers (default STATE_WARNING) and a note. A module is ignored while every error flag it has set is one of the rule. A rule applies on the device of the module; the leader of a swarm follows what its followers ignore.

Read the incidents and the health history

The Incidents service, with access level AUTHORIZED, keeps every incident for 90 days, at most 1000, across restarts; on the leader of a swarm those of the swarm.

  • list returns the incidents of the last time_span seconds (default 7 days), the newest first, optionally only the ongoing or unacknowledged ones.

  • watch streams each incident as it starts, changes, ends and is acknowledged. With delay, an incident is only reported as started once it lasted that many seconds, for example 300 to be alerted after 5 minutes and not for every short failure. An incident shorter than the delay is still reported as it ends, without a start before it: a client that pairs starts with ends has to expect an end alone.

  • acknowledge marks the incidents of the given ids as acknowledged, with an optional comment.

An incident is reported as ended, with its end time, as soon as its module is no cause any more. When the module is the cause again within a minute, the same incident, with the same id, is reported as started again, without end and with its recurrences counted up. Its error_flags are the error flags its cause set during it.

The method get_health_events of the TimeSeries service returns the changes of the health states of the modules of the device, with their error flags, for the last time_span seconds (default 24 hours). Each device records its own modules; ask each device of a swarm.