Skip to content

Instantly share code, notes, and snippets.

@fuzzmonkey
Created February 4, 2014 16:18
Show Gist options
  • Save fuzzmonkey/8806903 to your computer and use it in GitHub Desktop.
Save fuzzmonkey/8806903 to your computer and use it in GitHub Desktop.
Basic riemann config
; -*- mode: clojure; -*-
; vim: filetype=clojure
(logging/init :file "/var/log/riemann/riemann.log")
; Listen on the local interface over TCP (5555), UDP (5555), and websockets
; (5556)
(let [host "127.0.0.1"]
(tcp-server :host host)
(udp-server :host host)
(ws-server :host host))
; Expire old events from the index every 5 seconds.
(periodically-expire 5)
; Keep events in the index for 5 minutes by default.
(let [index (default :ttl 300 (update-index (index)))]
; Inbound events will be passed to these streams:
(streams
; Index all events immediately.
index
; Calculate an overall rate of events.
(with {:metric 1 :host nil :state "ok" :service "events/sec"}
(rate 5 index))
; Alert on high cpu load
/(where (and metric (service "cpu")(state "critical"))
; this could be email, or pagerduty or hipchat
(fn [event] (info "WARNING - high disk usage!!!" event)))
; Alert on high disk usuage
(where (and metric (service "disk")(state "critical"))
; this could be email, or pagerduty or hipchat
(fn [event] (info "WARNING - high disk usage!!!" event)))
; Alert on slow requests
(where (service "my-awesome-app.%.total_time")
; this could be email, or pagerduty or hipchat
(fn [event] (info "WARNING - slow requests on my-awesome-app!!!" event)))
))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment