{# hosts/overview_widget.html — the dashboard Hosts widget (#5251): a verdict, then one row per host, worst first, with its resources under one header. Load is shown against the host's cores and graded per core. Reachability and uptime belong to the Monitors widget, so they aren't repeated here. #} {% from "_macros.html" import status_dot %} {% if not rows %}
| Host | CPU | Mem | Disk / | Load |
|---|---|---|---|---|
| {{- status_dot(r.state) -}} {% if session.user_id %}{{ r.host.name }}{% else %}{{ r.host.name }}{% endif %} {%- if r.state == 'down' %}a monitor is down {%- elif r.state == 'stale' %}agent last reported {{ a.last_at|ago }}; figures are from then {%- elif not a %}no agent{% endif %} | {% for v, kind in ((a.get('cpu_pct'), 'cpu'), (a.get('mem_used_pct'), 'mem'), (a.get('disk_root'), 'disk')) %}{% if v is none %}—{% else %}{{ "%.0f"|format(v) }}%{% endif %} | {% endfor %}{%- if a.get('load_1m') is none %}—{% elif a.get('cores') %}{{ "%.1f"|format(a.load_1m) }} / {{ a.cores }} cores{% else %}{{ "%.1f"|format(a.load_1m) }}{% endif -%} |