{% import 'languages/'+lang|default('en')+'.html' as lang %} {%- for s in smon -%} {% if s.smon_id.en == 1 %} {% if s.smon_id.status == 1 and s.smon_id.body_status == 1 %} {% set additional_classes = 'good div-server-head-up' %} {% set uptime_desc = lang.words.uptime + ': ' %} {% elif s.smon_id.status == 0 or s.smon_id.body_status == 0 %} {% set additional_classes = 'err div-server-head-down' %} {% set uptime_desc = lang.words.downtime + ': ' %} {% else %} {% set additional_classes = 'err div-server-head-unknown' %} {% set uptime_desc = lang.words.uptime + ': N/A' %} {% endif %} {% else %} {% set additional_classes = 'dis div-server-head-dis' %} {% set uptime_desc = lang.words.uptime + ': N/A' %} {% endif %}
{{s.smon_id.name.strip("'")}} {% set agent_exist = [] %} {% for a in agents %} {% if a.id|string() == s.agent_id|string() %} {% if agent_exist.append(1) %} {% endif %} {% endif %} {% endfor %} {% if agent_exist|length == 0 %} ! {% endif %}
{% if s.smon_id.desc %} {{s.smon_id.desc.strip("'")}} {% else %} {{lang.words.desc|title()}}: {{lang.words.none}} {% endif %}
{{uptime_desc|safe}}
{% if s.smon_id.en == 1 %} {% if s.smon_id.status == 1 %} {{lang.smon_page.desc.resp_time}}: {% else %} {{lang.smon_page.desc.last_resp_time}}: {% endif %} {% if s.smon_id.response_time %} {{s.smon_id.response_time|truncate(9)}} ms {% else %} N/A {% endif %} {% else %} N/A {% endif %}
{{ lang.smon_page.desc.enabled_checks }}: {{ s.smon_id.check_type|upper }} {{lang.words.agent|title()}}: {% for a in agents %} {% if a.id|string() == s.agent_id|string() %} {{ a.name }} {% endif %} {% endfor %}
{% if s.smon_id.en == 1 and agent_exist|length > 0 %} {% if s.smon_id.status == 1 and s.smon_id.body_status == 1 %}
{{lang.smon_page.desc.UP}}
{% elif s.smon_id.status == 0 and s.smon_id.check_type == 'http' %}
{{lang.smon_page.desc.HTTP_FAILURE}}
{% elif s.smon_id.body_status == 0 %}
{{lang.smon_page.desc.BODY_FAILURE}}
{% elif s.smon_id.status == 3 %}
{{lang.smon_page.desc.UNKNOWN}}
{% else %}
{{lang.smon_page.desc.DOWN}}
{% endif %} {% elif agent_exist|length == 0 %}
{{lang.smon_page.desc.UNKNOWN}}
{% else %}
{{lang.smon_page.desc.DISABLED}}
{% endif %}
{%- endfor -%}