github.com/kcmerrill/alfred@v0.0.0-20180727171036-06445dcb5e3d/remote-modules/check.yml (about)

     1  http.slack:
     2      summary: HTTP Check
     3      usage: alfred /http.slack "website" "supersecretkey"
     4      dir: /tmp/http/{{ index .Args 0 }}
     5      command: wget {{ index .Args 0 }}
     6      ok: cleanup
     7      fail: send.notification
     8      every: 10s
     9  
    10  send.notification:
    11      dir: /tmp/http/{{ index .Args 0 }}
    12      command: test ! -f last_notified || test $(find -amin +{{ index .Args 2 }} | wc -l) -ge "2"
    13      private: true
    14      ok: notify
    15      defaults:
    16          - ""
    17          - ""
    18          - "60"
    19      private: true
    20  
    21  notify:
    22      dir: /tmp/http/{{ index .Args 0 }}
    23      summary: Send slack notification
    24      notify: slack "{{ index .Args 1 }}" "{{ index .Args 0 }} is down"
    25      command: touch last_notified
    26      private: true
    27  
    28  cleanup:
    29      dir: /tmp/http/{{ index .Args 0 }}
    30      command: |
    31          rm -rf last_notified
    32          rm -rf index.html*
    33      private: true