Uptime Report [{{ checks_date_range.start.strftime('%Y-%m-%d') }} - {{ checks_date_range.end.strftime('%Y-%m-%d')}}]

{# if 'nosummary' has been specified in the --report-jinja-flags, skip the summary #} {% if 'nosummary' not in flags -%}

{# use recursion to get summary stats at all levels #} {# NOTE: recursion is not needed if not using tag grouping or if the template is designed for a specific tag set #} {% macro print_summary_stats(data, label=[]) -%} {% set group_name = ' + '.join(label) if label else 'ALL' %} Average uptime for {{ group_name }} : {{ data._stats.gs_pct_avg|round(4) if data._stats.gs_pct_avg >= 0 else 'n/a' }}
{% for tag in data.keys() %} {% if tag[0] != '_' %} {{ print_summary_stats(data[tag], label=(label + [tag])) }} {% endif %} {% endfor %} {%- endmacro %} {{ print_summary_stats(checks_data) }}

{%- endif %}
{# use a recursive approach to table population, to support tags in a hierarchy #} {# NOTE: recursion is not needed if not using tag grouping or if the template is designed for a specific tag set #} {% macro table_populate(data, label=[]) -%} {% set group_name = ' + '.join(label) if label else 'ALL' %} {% for check in data._checks %} {% endfor %} {% for tag in data.keys() %} {% if tag[0] != '_' %} {{ table_populate(data[tag], label=(label + [tag])) }} {% endif %} {% endfor %} {%- endmacro %} {{ table_populate(checks_data) }}
Check Name
Uptime %
Downtime
average uptime {{ group_name }}
{{ data._stats.gs_pct_avg|round(4) }}
 
{{ check.name }}
{{ check.uptime.pct|round(4) }}
{{ check.uptime.totaldown|seconds_to_dhms }} 
{# if 'nofooter' has been specified in the --report-jinja-flags, skip the footer #} {% if 'nofooter' not in flags -%} {% endif %}