{# Unified Hosts widget — monitor status + agent glance per host, links to the hub. #} {% if hosts %}
{% for host in hosts %} {% set ping = latest_pings.get(host.id) %} {% set dns = latest_dns.get(host.id) %} {% set ut = uptime.get(host.id, {}) %} {% set a = agent.get(host.name, {}) %} {% set down = host.ping_enabled and ping and ping.status.value != 'up' %}
{{ host.name }} {# Monitors #} {% if host.ping_enabled and ping and ping.response_time_ms is not none %} ping {{ "%.0f"|format(ping.response_time_ms) }}ms {% endif %} {% if ut.get('24h') is not none %} 24h {{ "%.1f"|format(ut['24h']) }}% {% endif %} {# Agent glance #} {% if a %} {% if a.get('cpu_pct') is not none %}cpu {{ "%.0f"|format(a.cpu_pct) }}%{% endif %} {% if a.get('mem_used_pct') is not none %}mem {{ "%.0f"|format(a.mem_used_pct) }}%{% endif %} {% if a.get('disk_root') is not none %}disk / {{ "%.0f"|format(a.disk_root) }}%{% endif %} {% if not a.fresh %}stale{% endif %} {% else %} no agent {% endif %}
{% endfor %}
{% else %}
No hosts yet. Add one.
{% endif %}