{# plugins/snmp/templates/snmp/widget.html — the dashboard SNMP widget (#5255, milestone 491): a verdict, devices not answering first with why, then the rest, each with two readings in their units. The name links to its page. #} {% from "_macros.html" import status_dot %} {% if not total %}
No SNMP devices yet.{% if session.user_role == 'admin' %} Add one{% endif %}
{% else %} {% set down = devices | selectattr("reach", "equalto", "down") | list %}
{%- if counts.down == 1 and down %}{{ down[0].name }} isn't answering. {%- elif counts.down %}{{ counts.down }} of {{ total }} devices not answering. {%- elif counts.stale %}{{ counts.stale }} not polled recently. {%- 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': 'down', 'stale': 'stale', 'pending': 'pending'}.get(d.reach, 'up')) -}} {% if session.user_id %}{{ d.name }}{% else %}{{ d.name }}{% endif %} {%- if d.reach == 'down' %}{% if d.ok_at %}no reply since {{ d.ok_at|ago }}{% else %}never answered{% endif %} {%- elif d.reach == 'stale' %}not polled since {{ d.polled_at|ago }} {%- elif d.reach == 'pending' %}not polled yet{% endif %} {%- for r in d.key %}{{ r.name }} {{ r.text }}{% if not loop.last %} · {% endif %}{% else %}—{% endfor -%} {% if d.polled_at %}{{ d.polled_at|ago }}{% else %}—{% endif %}
{% if more %}
+{{ more }} more{% if session.user_id %} · all devices{% endif %}
{% endif %} {% endif %}