GithubHelp home page GithubHelp logo

sensu-graphite-alerts's Introduction

Sensu-Graphite-Alerts

Set of Sensu tools used to generate check results agains Graphite metrics

Motivation

Why do we need it? Using Graphite one can store and analyze a huge amount of data. At some point you may need to create multiple (ok, to put it clean dozens and dozens) of checks against data stored in Graphite.

For instance, you can have metrics organized like this:

  • myserver.load_avg.*
  • myserver.vmstat.*
  • myserver.postfix.*

It is easy to use Sensu-Graphite community plugin to check that load_avg.one is in comfortable scale. But thing get much more complicated if you have around 100 or server, each with 10-20 metrics to control.

How does it work?

Diagram

  1. alerts-publisher.rb should be added as a regular sensu check, like this:

    "alerts-publisher": { "command": "/etc/sensu/plugins/alerts-publisher.rb", "subscribers": [ "your-sensu-server" ], "interval": 60, "type": "check" }

alerts-publisher reads configuration and finds section alerts with array of alerts defined like this:

{
  "alerts" : 
  [
		{
			"name" : "apache_processes",
			"hostname" : "myserver-node",
			"metric" : "summarize(scale(divideSeries(maxSeries(myserver.node.apache.busy),averageSeries(myserver.node.apache.total)),100),\"5min\")",
			"from" : "-10min",
			"comparator" : "gt",
			"threshold" : "20",
			"subject" : "WARNING: High number of apache processes",
			"description": "Server is running high number of Apache busy processes",
			"email": "[email protected]"
    }
  ]
}
  1. This check (in JSON) goes to RabbitMQ and then is fetched by alerts-server.rb

  2. alerts-server.rb can run on any host, but it was intended to be detached from alerts-publisher for two reasons:

  • graphite server can be on different host
  • there can be multiple graphite installations. In this case each alerst-server will query its own graphite, balancing the load on servers
  1. Graphite response is compared with threshold and result is sent to sensu server

  2. In case of result is in status different from 0 (ok), then mailer.rb sends a mail to email from alert description

It should be noted, that in order to reduce the number of mails sent, mailer.rb sends mail only if there is a switch from ok to critical. Thus multiple critical checks results will be absorbed

sensu-graphite-alerts's People

Contributors

werdan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sensu-graphite-alerts's Issues

License?

What is the license for these plugins?

how to start alert-server.rb

i have no idea to configure the alert to check graphite, when i have done something as werdan said, i found that i can not tigger the alert-server.rb, how can i configure this,thanks.

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.