{% extends "base.html" %} {% from "_macros.html" import crumbs %} {% from "monitors/_fields.html" import type_fields, toggle_script %} {% block title %}{{ host.name }} — Hosts — Steward{% endblock %} {% block breadcrumb %}{{ crumbs([("Hosts", "/hosts/"), (host.name, "")]) }}{% endblock %} {% block content %}

{{ host.name }}

{{ host.address or "no address — resolves by name" }}
Edit {% if session.user_role == 'admin' %}
{% endif %}
{% set inp = "width:100%;padding:0.4rem 0.65rem;background:var(--bg);border:1px solid var(--border-mid);border-radius:4px;color:var(--text);font-size:0.88rem;" %} {% set lbl = "font-size:0.75rem;color:var(--text-muted);display:block;margin-bottom:0.2rem;" %} {# ── Live vitals strip (host_agent fragment) — full width on top, polled ────── #}
{# ── Monitors + Agent, side by side on wide screens, stacked when narrow ────── #}
{# ── Monitors ─────────────────────────────────────────────────────────────── #}

Monitors

{% if uptime %} uptime 24h {{ ("%.1f%%"|format(uptime['24h'])) if uptime['24h'] is not none else '—' }} · 7d {{ ("%.1f%%"|format(uptime['7d'])) if uptime['7d'] is not none else '—' }} · 30d {{ ("%.1f%%"|format(uptime['30d'])) if uptime['30d'] is not none else '—' }} {% endif %}
{% if monitors %} {% for d in monitors %} {% set m = d.monitor %} {% set latest = d.latest %}
{{ m.type | upper }} {{ m.name }} {{ m.target }}
{% for _ in range([30 - d.heartbeat|length, 0]|max) %} {% endfor %} {% for h in d.heartbeat %} {% endfor %}
{% if latest is none %} {% elif not latest.is_up %}DOWN {% elif latest.response_ms is not none %} {{ "%.0f"|format(latest.response_ms) }} ms {% else %}UP{% endif %}
{% if session.user_role in ['operator', 'admin'] %}
Edit
{% endif %}
{% endfor %} {% else %}

No monitors yet for this host. Add one below.

{% endif %} {% if session.user_role in ['operator', 'admin'] %}
+ Add monitor for this host
{{ type_fields() }}
{% endif %}
{# Monitors card #} {# ── Agent (host_agent management panel) ──────────────────────────────────── #}
Loading agent…
{# Monitors + Agent grid #} {# ── Ansible (full width) ─────────────────────────────────────────────────── #}

Ansible

{% if linked_target %}
{{ linked_target.name }} {{ linked_target.address }} {% if linked_target.groups %}
{% for grp in linked_target.groups %} {{ grp.name }} {% endfor %}
{% endif %}
Edit target
{% if ansible_sources %}
Run a playbook against this host
Advanced
{% endif %} {% else %}

No Ansible target linked. A target gives this host an SSH connection so Steward can run playbooks and provision the agent.

{% if linkable_targets %}
{% endif %}
{% endif %}
{# Ansible card #} {# ── Docker (docker plugin fragment; renders nothing if the host has none) ──── #} {% if "docker" in enabled_plugins %}
{% endif %} {# ── SNMP (renders nothing unless a configured SNMP device maps to this host) ── #} {% if "snmp" in enabled_plugins %}
{% endif %} {{ toggle_script() }} {% endblock %}