{# plugins/snmp/templates/snmp/widget.html — the dashboard SNMP widget (#5255): a verdict, devices that stopped answering first with since when, then the rest, each with its status in words and its key readings, named and with units. The device name links to its page. #} {% from "_macros.html" import status_dot %} {% if not total %}
No SNMP devices configured.
{% else %} {% set stale = devices | selectattr("reach", "equalto", "stale") | list %}
{%- if counts.stale == 1 and stale %}{{ stale[0].name }}: no reply since {{ stale[0].at|ago }}. {%- elif counts.stale %}{{ counts.stale }} of {{ total }} devices not answering. {%- elif counts.pending %}{{ counts.pending }} not polled yet, {{ counts.up }} answering. {%- else %}All {{ total }} device{{ 's' if total != 1 }} answering.{% endif -%}
{% for d in devices %} {% endfor %}
DeviceReadingsPolled
{{- status_dot('down' if d.reach == 'stale' else ('pending' if d.reach == 'pending' else 'up')) -}} {% if session.user_id %}{{ d.name }}{% else %}{{ d.name }}{% endif %} {%- if d.reach == 'stale' %}no reply since {{ d.at|ago }}; readings are from then {%- elif d.reach == 'pending' %}no data yet{% endif %} {%- for n, v in d.key %}{{ n }} {{ v }}{% if not loop.last %} · {% endif %}{% else %}—{% endfor -%} {% if d.at %}{{ d.at|ago }}{% else %}—{% endif %}
{% if more %}
+{{ more }} more{% if session.user_id %} · all devices{% endif %}
{% endif %} {% endif %}