Skip to content

Instantly share code, notes, and snippets.

@perezd
Created October 24, 2012 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perezd/1420f4e7495e6f4fa171 to your computer and use it in GitHub Desktop.
Save perezd/1420f4e7495e6f4fa171 to your computer and use it in GitHub Desktop.
; monitoring uptime is based on whether or not
; we've received a state of up for a given property.
(defn monitor-uptime-with-pd [service-name]
(streams
(changed-state
(where (and (service service-name)
(or (state "up")
(state "ok")))
prn
(:resolve pd))
(where (and (service service-name)
(not (or (state "up")
(state "ok"))))
prn
(:trigger pd)))))
(monitor-uptime-with-pd #"frontend\.http\.\d{4}\.status")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment