You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

  1. {% load hc_extras humanize %}
  2. {
  3. "username": "{% site_name %}",
  4. "icon_url": "{% site_root %}/static/img/[email protected]",
  5. "attachments": [{
  6. {% if check.status == "up" %}
  7. "color": "good",
  8. {% else %}
  9. "color": "danger",
  10. {% endif %}
  11. "fallback": "The check \"{{ check.name_then_code|escapejs }}\" is {{ check.status|upper }}.",
  12. "mrkdwn_in": ["fields"],
  13. "text": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}.",
  14. "fields": [
  15. {% if check.kind == "simple" %}
  16. {"title": "Period",
  17. "value": "{{ check.timeout|hc_duration }}",
  18. "short": true
  19. },
  20. {% elif check.kind == "cron" %}
  21. {"title": "Schedule",
  22. "value": "{{ check.schedule }}",
  23. "short": true
  24. },
  25. {% endif %}
  26. {"title": "Last Ping",
  27. {% if check.last_ping %}
  28. "value": "{{ check.last_ping|naturaltime }}",
  29. {% else %}
  30. "value": "Never",
  31. {% endif %}
  32. "short": true
  33. },
  34. {% if check.tags_list %}
  35. {"title": "Tags",
  36. "value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}",
  37. "short": true
  38. },
  39. {% endif %}
  40. {"title": "Total Pings",
  41. "value": "{{ check.n_pings }}",
  42. "short": true
  43. }
  44. ]
  45. }]
  46. }