{# Per-host SNMP fragment — embedded on the Hosts hub via HTMX. Self-contained. Shows the SNMP device(s) whose address maps to this host + latest readings. #}

SNMP

All devices →
{% for device in devices %}
{{ device.name }} {{ device.host }} {% if device.bound %} bound {% endif %} {% if device.readings %} ● reachable {% else %} ○ no data yet {% endif %} History
{% if device.readings %}
{% for oid_cfg in device.oids %} {% set label = oid_cfg.label if oid_cfg.label else oid_cfg.oid %} {% set val = device.readings.get(label) %}
{{ label }}
{% if val is not none %}
{% if val >= 1000000 %}{{ "%.2f"|format(val / 1000000) }}M {% elif val >= 1000 %}{{ "%.1f"|format(val / 1000) }}K {% else %}{{ "%.4g"|format(val) }}{% endif %}
{% else %}
{% endif %}
{% endfor %}
{% else %}

No readings yet — waiting for the next poll.

{% endif %}
{% endfor %}