Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; -*- mode: clojure; -*-
- ; vim: filetype=clojure
- (logging/init {:file "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)
- ;; Email
- (let [mail-opts {:host "localhost"
- :port 25
- :from "root@localhost"
- :to ["root@localhost"]}]
- (def email (mailer mail-opts))
- (def email-daily (throttle 1 86400 (email)))
- )
- (let [index (index)]
- ; Inbound events will be passed to these streams:
- (streams
- (default :ttl 60
- (where (service "riemann server tcp 127.0.0.1:5555 in rate")
- index #(info %) email-daily)
- (where (service "riemann server tcp 127.0.0.1:5555 conns")
- index #(info %) email-daily)
- ; Log expired events.
- (expired
- (fn [event] (info "expired" event))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement