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.

64 lines
1.9 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.desc %}
  16. {"title": "Description",
  17. "value": "{{ check.desc|escapejs }}"
  18. },
  19. {% endif %}
  20. {% if check.project.name %}
  21. {"title": "Project",
  22. "value": "{{ check.project.name|escapejs }}",
  23. "short": true
  24. },
  25. {% endif %}
  26. {% if check.tags_list %}
  27. {"title": "Tags",
  28. "value": "{% for tag in check.tags_list %}`{{ tag|escapejs }}` {% endfor %}",
  29. "short": true
  30. },
  31. {% endif %}
  32. {% if check.kind == "simple" %}
  33. {"title": "Period",
  34. "value": "{{ check.timeout|hc_duration }}",
  35. "short": true
  36. },
  37. {% elif check.kind == "cron" %}
  38. {"title": "Schedule",
  39. "value": "{{ check.schedule|fix_asterisks|escapejs }}",
  40. "short": true
  41. },
  42. {% endif %}
  43. {"title": "Last Ping",
  44. {% if check.last_ping %}
  45. "value": "{{ check.last_ping|naturaltime }}",
  46. {% else %}
  47. "value": "Never",
  48. {% endif %}
  49. "short": true
  50. },
  51. {"title": "Total Pings",
  52. "value": "{{ check.n_pings }}",
  53. "short": true
  54. }
  55. ]
  56. }]
  57. }