{% extends "resources/base.html" %} {% import "site_shell/_macros.html" as ui %} {% block title %}Health - {{ resource.name }} - Pychestrate Resources{% endblock %} {% block content %} {% set typed = form_data or {} %} {% set current_status = typed.get('status') or resource.health_status %}

Current Status

{% set status = resource.health_status %} {% if status == 'online' %}
Online
Resource is healthy and available for allocation
{% elif status == 'offline' %}
Offline
Resource is unavailable - allocations blocked
{% elif status == 'degraded' %}
Degraded
Resource is partially functional - allocations allowed
{% elif status == 'maintenance' %}
Maintenance
Resource is under maintenance - allocations blocked
{% else %}
{{ status | capitalize }}
Unrecognized health status
{% endif %}
{% if config %}

Health Check Configuration

{% if config.probe_command %} {% endif %} {% if config.enabled and config.check_requested_at %} {% endif %}
Enabled {% if config.enabled %} Yes {% else %} No {% endif %}
Probe URL {{ config.probe_url or '—' }}
Probe Command {{ config.probe_command }} — not run: command probes are no longer supported. Reconfigure this check with a probe URL.
Last check {% if config.last_check_time %} {{ config.last_check_time | format_datetime('%Y-%m-%d %H:%M:%S', '—') }} {% if config.last_check_result == true %} Passed {% elif config.last_check_result == false %} Failed {% else %} Not run {% endif %} {% if config.last_check_message %}
{{ config.last_check_message }}
{% endif %} {% else %} Not checked yet {% endif %}
Queued check A check was requested at {{ config.check_requested_at | format_datetime('%Y-%m-%d %H:%M:%S', '—') }} and is waiting for the background worker. Refresh to see the result. {% if check_queue_stale %}
It has waited longer than expected. Check that the housekeeping worker is running.
{% endif %}
Interval {{ config.interval_seconds }} seconds
Timeout {{ config.timeout_seconds }} seconds
Failure Threshold {{ config.failure_threshold }} consecutive failures
Success Threshold {{ config.success_threshold }} consecutive successes
{% endif %}

Health Transition History

{% if history %}
{% for transition in history %} {% endfor %}
Timestamp From To Reason Triggered By
{{ transition.timestamp | format_datetime('%Y-%m-%d %H:%M:%S', '—') }} {% if transition.old_status == 'online' %} Online {% elif transition.old_status == 'offline' %} Offline {% elif transition.old_status == 'degraded' %} Degraded {% else %} {{ transition.old_status }} {% endif %} {% if transition.new_status == 'online' %} Online {% elif transition.new_status == 'offline' %} Offline {% elif transition.new_status == 'degraded' %} Degraded {% else %} {{ transition.new_status }} {% endif %} {{ transition.reason or '—' }} {{ transition.triggered_by }}{% if transition.username %} ({{ transition.username }}){% endif %}
{{ ui.pagination('resources.health_detail', page, total_pages, {'resource_id': resource.id, 'per_page': per_page}, total=total) }} {% else %}

No health transitions recorded

{% endif %}
{% if can_manage %}

Update Status

{{ ui.error_summary(errors, error_labels) }}
{{ ui.field_error(errors, "status") }}
{{ ui.field_error(errors, "reason") }}
{% endif %}

Actions

{% if can_manage %} {{ ui.icon("settings") }} Configure Health Check
{% endif %} {{ ui.icon("devices") }} View Resource
{% endblock %}