|
|
@ -15,58 +15,72 @@ |
|
|
|
"title_link": "{{ check.cloaked_url }}", |
|
|
|
"fields": [ |
|
|
|
{% if check.desc %} |
|
|
|
{"title": "Description", |
|
|
|
"value": "{{ check.desc|escapejs }}" |
|
|
|
}, |
|
|
|
{ |
|
|
|
"title": "Description", |
|
|
|
"value": "{{ check.desc|escapejs }}" |
|
|
|
}, |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% if check.project.name %} |
|
|
|
{"title": "Project", |
|
|
|
"value": "{{ check.project.name|escapejs }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"title": "Project", |
|
|
|
"value": "{{ check.project.name|escapejs }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% if check.tags_list %} |
|
|
|
{"title": "Tags", |
|
|
|
"value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"title": "Tags", |
|
|
|
"value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{% if check.kind == "simple" %} |
|
|
|
{"title": "Period", |
|
|
|
"value": "{{ check.timeout|hc_duration }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"title": "Period", |
|
|
|
"value": "{{ check.timeout|hc_duration }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{% elif check.kind == "cron" %} |
|
|
|
{"title": "Schedule", |
|
|
|
"value": "{{ check.schedule|fix_asterisks|escapejs }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{ |
|
|
|
"title": "Schedule", |
|
|
|
"value": "{{ check.schedule|fix_asterisks|escapejs }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
{% endif %} |
|
|
|
|
|
|
|
{"title": "Last Ping", |
|
|
|
{% if ping is None %} |
|
|
|
"value": "Never", |
|
|
|
{% elif ping.kind == "ign" %} |
|
|
|
"value": "Ignored, {{ ping.created|naturaltime }}", |
|
|
|
{% elif ping.kind == "fail" or ping.exitstatus > 0 %} |
|
|
|
"value": "Failure, {{ ping.created|naturaltime }}", |
|
|
|
{% elif ping.kind == "start" %} |
|
|
|
"value": "Start, {{ ping.created|naturaltime }}", |
|
|
|
{% elif ping.kind == "log" %} |
|
|
|
"value": "Log, {{ ping.created|naturaltime }}", |
|
|
|
{% else %} |
|
|
|
"value": "Success, {{ ping.created|naturaltime }}", |
|
|
|
{% endif %} |
|
|
|
"short": true |
|
|
|
{ |
|
|
|
"title": "Total Pings", |
|
|
|
"value": "{{ check.n_pings }}", |
|
|
|
"short": true |
|
|
|
}, |
|
|
|
|
|
|
|
{"title": "Total Pings", |
|
|
|
"value": "{{ check.n_pings }}", |
|
|
|
"short": true |
|
|
|
{ |
|
|
|
"title": "Last Ping", |
|
|
|
{% if ping is None %} |
|
|
|
"value": "Never", |
|
|
|
{% elif ping.kind == "ign" %} |
|
|
|
"value": "Ignored, {{ ping.created|naturaltime }}", |
|
|
|
{% elif ping.kind == "fail" or ping.exitstatus > 0 %} |
|
|
|
"value": "Failure, {{ ping.created|naturaltime }}", |
|
|
|
{% elif ping.kind == "start" %} |
|
|
|
"value": "Start, {{ ping.created|naturaltime }}", |
|
|
|
{% elif ping.kind == "log" %} |
|
|
|
"value": "Log, {{ ping.created|naturaltime }}", |
|
|
|
{% else %} |
|
|
|
"value": "Success, {{ ping.created|naturaltime }}", |
|
|
|
{% endif %} |
|
|
|
"short": true |
|
|
|
} |
|
|
|
|
|
|
|
{% if body %}, |
|
|
|
{ |
|
|
|
"title": "Last Ping Body", |
|
|
|
"value": "```{{ body|slice:":1000"|escapejs }}{% if body|length > 1000 %}\n[truncated]{% endif %}```" |
|
|
|
} |
|
|
|
{% endif %} |
|
|
|
] |
|
|
|
}] |
|
|
|
} |