Skip to content

Instantly share code, notes, and snippets.

@dch
Forked from faxm0dem/riemann-config.clj
Last active May 24, 2017 18:08
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 dch/0318030ef7124ea348f9c16fe475ddd1 to your computer and use it in GitHub Desktop.
Save dch/0318030ef7124ea348f9c16fe475ddd1 to your computer and use it in GitHub Desktop.
riemann collectd watchdog
(streams
(with {:service "heartbeat" :ttl 120 } (index))
(where (service "heartbeat")
(by :host (...))))
(streams (default {:state "ok"}
index
(by :host
(where (service "heartbeat")
(changed expired?
(where (expired? event)
(with {:state "critical"}
alert!)
(else alert!))))
(where (and (tagged "collectd") (not (service "heartbeat")) (not (expired? event)))
(with {:service "heartbeat" :ttl heartbeat-timeout}
(throttle 1 (/ heartbeat-timeout 2)
reinject)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment