{# Host health header — live polled into the host hub: live or stale, the worst reading against Settings → Thresholds, last seen, then CPU / memory / disk / load tiles graded by the same cutoffs (`grades`; CPU, memory and load within the host's own normal for the hour read healthy, and `usual` says so). Renders nothing until the agent reports (the Agent panel below then shows provisioning). #} {% from "_macros.html" import status_badge, stat_tile %} {% macro pct(v) %}{{ '%.0f%%'|format(v) if v is not none else '—' }}{% endmacro %} {% set grades = grades or {} %} {% if reporting %}
{{ status_badge('stale' if stale else 'up', 'Stale' if stale else 'Live') }} {%- if stale %}No report since {{ reg.last_seen_at|ago }}; the readings below are from then. {%- elif worst %}{{ worst[0] }} {{ pct(worst[1]) }} is past its {{ "critical" if worst[2] == "crit" else "warning" }} threshold. {%- elif usual %}Every reading is within its thresholds or its usual level for this hour. {%- else %}Every reading is within its thresholds.{% endif -%} {%- if not stale %}seen {{ reg.last_seen_at|ago }}{% endif %} {%- if reg.agent_version %}{{ " · " if not stale }}agent v{{ reg.agent_version }}{% endif -%} {%- if clock and clock[0] %} · {{ clock[0] }}{% endif -%}
{{ stat_tile("CPU", pct(cpu), state=(grades.cpu or [status_class(cpu, 'cpu')])[0], hint=sparks.cpu|safe) }} {{ stat_tile("Memory", pct(mem), state=(grades.mem or [status_class(mem, 'mem')])[0], hint=sparks.mem|safe) }} {%- set inodes_worse = inodes_root is defined and inodes_root is not none and (disk_root is none or inodes_root > disk_root) %} {{ stat_tile("Disk /", pct(disk_root) ~ (" · inodes " ~ pct(inodes_root) if inodes_worse else ""), state=(grades.disk or [status_class(disk_root, 'disk')])[0], hint=sparks.disk|safe) }} {{ stat_tile("Load per core", pct(load_per_core), state=(grades.load or [status_class(load_per_core, 'load')])[0], hint=sparks.load|safe) }}
{% if usual and not stale %}

{{ usual | join("; ") | capitalize }}.

{% endif %} {% if psi.cpu is not none or psi.mem is not none or psi.io is not none %}

Pressure (10 s): cpu {{ pct(psi.cpu) }} · mem {{ pct(psi.mem) }} · io {{ pct(psi.io) }}

{% endif %}
{% endif %}