Advertisement
Guest User

Untitled

a guest
Dec 24th, 2019
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; -*- mode: clojure; -*-
  2. ; vim: filetype=clojure
  3.  
  4. (logging/init {:file "riemann.log"})
  5.  
  6. ; Listen on the local interface over TCP (5555), UDP (5555), and websockets
  7. ; (5556)
  8. (let [host "127.0.0.1"]
  9.   (tcp-server {:host host})
  10.   (udp-server {:host host})
  11.   (ws-server  {:host host}))
  12.  
  13. ; Expire old events from the index every 5 seconds.
  14. (periodically-expire 5)
  15.  
  16. ;; Email
  17. (let [mail-opts {:host "localhost"
  18.                  :port 25
  19.                  :from "root@localhost"
  20.                  :to   ["root@localhost"]}]
  21.  
  22.   (def email (mailer mail-opts))
  23.   (def email-daily (throttle 1 86400 (email)))
  24.   )
  25.  
  26.  
  27. (let [index (index)]
  28.   ; Inbound events will be passed to these streams:
  29.   (streams
  30.     (default :ttl 60
  31.  
  32.       (where (service "riemann server tcp 127.0.0.1:5555 in rate")
  33.         index #(info %) email-daily)
  34.  
  35.       (where (service "riemann server tcp 127.0.0.1:5555 conns")
  36.         index #(info %) email-daily)
  37.  
  38.       ; Log expired events.
  39.       (expired
  40.         (fn [event] (info "expired" event))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement