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.

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