{% extends "base.html" %} {% from "_macros.html" import status_badge, status_dot %} {# Hosts, problems first (host_svc.host_rank): a down monitor, then an agent gone quiet, then monitors not yet checked, then the healthy. #} {% macro pct(v) %}{% if v is none %}—{% else %}{{ '%.0f'|format(v) }}%{% endif %}{% endmacro %} {% block title %}Hosts — Steward{% endblock %} {% block content %}

Hosts

SLA {% if session.user_role == 'admin' %} Agent fleet {% endif %} Add Host
{% if hosts %}
{% for host in hosts %} {% set hs = host_status.get(host.id) %} {% set ut = uptime.get(host.id, {}) %} {% for window in ["24h", "7d", "30d"] %} {% set pct = ut.get(window) %} {% endfor %} {% set am = agent.get(host.name) %} {% endfor %}
Name Address Status Latency Monitors 24h 7d 30d Agent
{{ host.name }} {{ host.address }} {% if not hs %} — {% else %}{{ status_dot(hs.state) }}{% endif %} {% if hs and hs.latency_ms is not none %} {{ hs.latency_ms | round(1) }} ms {% else %} — {% endif %} {{ hs.count if hs else 0 }} {% if pct is none %} — {% else %} {{ "%.1f"|format(pct) }}% {% endif %} {% if am %} {{ pct(am.cpu_pct) }} / {{ pct(am.mem_used_pct) }} {% if not am.fresh %}
{{ status_badge('stale', title="No agent report since " ~ (am.last_at.strftime('%Y-%m-%d %H:%M UTC') if am.last_at else 'it started')) }} {{ am.last_at|ago }}
{% endif %} {% else %} — {% endif %}
Edit
{{ csrf_field() }}
{% else %}

No hosts yet. Summon one to the table.

{% endif %} {% endblock %}