2

I'm new to Riemann and clojure. I'm trying to configure alerts based on changed states. But the states never seem to be updated/indexed. So when I get to the changed-state block, state is nil. I can add the alerts within the splitp block, but that seems redundant. Maybe we will want different types of notifications between critical and warnings, but for now, I'd like to see this work (if possible).

(let [index (default :ttl 20 (index))]
  (streams
    index
    (where (not (state "expired"))
      (where (service "load/load/shortterm")
        (splitp < metric
          0.05 (with :state "critical" index)
          0.02 (with :state "warning" index)
               (with :state "ok" index))
      )
      #(info %)
      (changed-state {:init "ok"}
        (stable 60 :state
          #(info "CHANGED STATE" %)
          (email "user@host.com")))
    )
  )
)

Thanks for any help!

Riemann v0.2.9, collectd v5.5.0, OS CentOS 6.5

juicedM3
  • 501
  • 5
  • 5
  • I suspect that you can't use (changed-state) with (stable). (stable) looks for a sequence of at least 2 identical states in the time period. (changed-state) would only every pass along events with different states. Did you ever come up with an alternative? – Jeff Strunk Dec 07 '15 at 14:20
  • 2
    Looking over the docs further, I found your example. It looks like you need your :ttl to be higher than the timeout for (stable). – Jeff Strunk Dec 07 '15 at 15:28

0 Answers0