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.

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