Code Monkey home page Code Monkey logo

riemann-cond-dt-plugin's Introduction

riemann-cond-dt-plugin

A plugin for verifying that a condition on an event is true during a time period.

Clojars Project

Howto

Loading the plugin

First, you should download the .jar file, and tell Riemann how to find it in your system using the /etc/default/riemann or /etc/sysconfig/riemann file and the EXTRA_CLASSPATH option.

Then, on your riemann.config file, add:

(load-plugins)

(require '[riemann-cond-dt.core :as cd])

You are now ready to use the plugin !

Streams

above

Takes a number threshold and a time period in seconds dt.

If the condition (> (:metric event) threshold) is valid for all events received during at least the period dt, valid events received after the dt period will be passed on until an invalid event arrives.

:metric should not be nil (it will produce exceptions).

(cd/above 1000 60 #(info %))

below

Takes a number threshold and a time period in seconds dt.

If the condition (< (:metric event) threshold) is valid for all events received during at least the period dt, valid events received after the dt period will be passed on until an invalid event arrives.

:metric should not be nil (it will produce exceptions).

(cd/below 1000 60 #(info %))
between

Takes two numbers, low and high, and a time period in seconds, dt.

If the condition (and (> (:metric event) low) (< (:metric event) high)) is valid for all events received during at least the period dt, valid events received after the dt period will be passed on until an invalid event arrives.

:metric should not be nil (it will produce exceptions)."

(cd/between 1000 10000 60 #(info %))

outside

Takes two numbers, low and high, and a time period in seconds, dt.

If the condition (or (< (:metric event) low) (> (:metric event) high)) is valid for all events received during at least the period dt, valid events received after the dt period will be passed on until an invalid event arrives.

:metric should not be nil (it will produce exceptions).

(cd/outside 1000 10000 60 #(info %))

critical

Takes a time period in seconds dt.

If all events received during at least the period dt have :state critical, new critical events received after the dt period will be passed on until an invalid event arrives.

(cd/critical 60 #(info %))

cond-dt

A stream which detects if a condition (f event) is true during dt seconds. Takes a function of events f and a time period dt in seconds.

If the condition is valid for all events received during at least the period dt, valid events received after the dt period will be passed on until an invalid event arrives.

Skips events that are too old or that do not have a timestamp.

For example, you can reimplement critical using cond-dt:

(cd/cond-dt (fn [event] (= (:state event) "critical")) 60 #(info %))

riemann-cond-dt-plugin's People

Contributors

mcorbin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

martinwangjian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.