{# plugins/snmp/templates/snmp/index.html #} {% extends "base.html" %} {% from "_macros.html" import page_header, status_badge, stat_tile, empty_state %} {% block title %}SNMP — Steward{% endblock %} {% block content %} {{ page_header("SNMP devices", devices|length ~ " device" ~ ("s" if devices|length != 1 else "") ~ " configured") }} {% if not devices %}
{{ empty_state("No SNMP devices configured. Add them to the snmp plugin's plugin.yaml.") }}
{% else %} {% for device in devices %}
{{ status_badge('up', 'Reachable') if device.readings else status_badge('pending', 'No data yet') }}

{{ device.name }}

{{ device.host }} 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) %} {{ stat_tile(label, "—" if val is none else ("%.2fM"|format(val / 1000000)) if val >= 1000000 else ("%.1fK"|format(val / 1000)) if val >= 1000 else "%.4g"|format(val)) }} {% endfor %}
{% else %}

No readings yet; waiting for the next poll.

{% endif %}
{% endfor %} {% endif %} {% endblock %}