Monitoring with sensu

45
Monitoring with

description

Overview of the Sensu monitoring framework

Transcript of Monitoring with sensu

Page 1: Monitoring with sensu

Monitoring with

Page 2: Monitoring with sensu

First of all...

Page 3: Monitoring with sensu

First of all...

Page 4: Monitoring with sensu

Why we (me) don’t like Nagios?

• No active-active cluster

Page 5: Monitoring with sensu

Why we (me) don’t like Nagios?

• No active-active cluster (nor easy active-passive one)

Page 6: Monitoring with sensu

Why we (me) don’t like Nagios?

• No active-active cluster (nor easy active-passive one)

Page 7: Monitoring with sensu

Why we (me) don’t like Nagios?

• No active-active cluster (nor easy active-passive one)

• Restart after adding a host (auto-scaling anyone??)

Page 8: Monitoring with sensu

Why we (me) don’t like Nagios?

• No active-active cluster (nor easy active-passive one)

• Restart after adding a host (auto-scaling anyone??)

• (Really) difficult to hack on

Page 9: Monitoring with sensu

Why we (me) don’t like Nagios?

• The master executes the checks (all of them!)

Page 10: Monitoring with sensu

Why we (me) don’t like Nagios?

• The master executes the checks (all of them!)

• Painful config reloads if using slaves

Page 11: Monitoring with sensu

Why we (me) don’t like Nagios?

• The master executes the checks (all of them!)

• Painful config reloads if using slaves

• (Quite) hard to configure

Page 12: Monitoring with sensu

Why we (me) don’t like Nagios?

• First release: March 14, 1999

Page 13: Monitoring with sensu

Why we (me) don’t like Nagios?

• First release: March 14, 1999

Page 14: Monitoring with sensu
Page 15: Monitoring with sensu

What’s Sensu?

• A monitoring framework

• They say “monitoring router”

• It takes results of checks and passes them to handlers

Page 16: Monitoring with sensu

Sensu facts

• Active-active cluster

Page 17: Monitoring with sensu

Sensu facts

• Active-active cluster

• Hosts automagically registered when agent starts

Page 18: Monitoring with sensu

Sensu facts

• Active-active cluster

• Hosts automagically registered when agent starts

• Written in Ruby

Page 19: Monitoring with sensu

Sensu facts

• Clients execute all the checks (all of them!)

Page 20: Monitoring with sensu

Sensu facts

• Clients execute all the checks (all of them!)

• No need to have slaves (but you can if you want to)

Page 21: Monitoring with sensu

Sensu facts

• Clients execute all the checks (all of them!)

• No need to have slaves (but you can if you want to)

• Configured with small JSON files

Page 22: Monitoring with sensu

Sensu facts

• Clients execute all the checks (all of them!)

• No need to have slaves (but you can if you want to)

• Configured with small JSON files

• Compatible with Nagios plugins!

Page 23: Monitoring with sensu

Sensu facts

• IT’S 2014

Page 24: Monitoring with sensu

Sensu facts

• IT’S 2014

Page 25: Monitoring with sensu

What does Sensu provide?

• Agent (client) to gather check results

• Server to take actions (or not) on these results

• REST API to query the state

• Optional dashboard to query the API

Page 26: Monitoring with sensu

What does Sensu NOT provide?

• Storage for the results history

• Notifications

• Graphing

Page 27: Monitoring with sensu

Architecture overview

Page 28: Monitoring with sensu

Two modes of operation

Page 29: Monitoring with sensu

Subscription

subscription messages

Page 30: Monitoring with sensu

Subscription

check request

Page 31: Monitoring with sensu

Subscription

check results

Page 32: Monitoring with sensu

Standalone

Page 33: Monitoring with sensu

Standalone

check results

Page 34: Monitoring with sensu

• Modes can be mixed

• The client also listens for results in a socket– Throw JSON to it from your application

Page 35: Monitoring with sensu
Page 36: Monitoring with sensu

Handlers

• Each check can have its own handler

• Sensu considers only results flagged as “metrics” and not-ok’s

Page 37: Monitoring with sensu

Handler types

• Pipe: the server executes a script and throws the event as JSON to the standard input

• TPC and UDP: the server connects to a host and port and delivers the event

• AMQP: the event can be reinjected in the broker for further routing

Page 38: Monitoring with sensu
Page 39: Monitoring with sensu

Handling events selectively

• What if you don’t want to handle some events?

• REST API to the rescue

Page 40: Monitoring with sensu

Stashes

• A stash is associated with an ID (a “path”)

• You can store here as much shit as you want

• Put a “silence” in the stash, and make your handlers check for it.

Page 41: Monitoring with sensu

Mutators

• A filter to modify event data before passing it to a handler.

• Example: manipulate events to make them suitable for graphite before passing them to a TCP handler

Page 42: Monitoring with sensu

Extensions

• Mutators and Handlers running in the same process than Sensu

• They must be written also in Ruby

• Run in the same event loop

Page 43: Monitoring with sensu
Page 44: Monitoring with sensu

Things missing / rant

• You can’t monitor something if you can’t install an agent on it.– There’s a ticket open since more than one year

ago...– Some patches, but still not a solution

• As with nagios, the state is decided by the plugins.

Page 45: Monitoring with sensu

Further research

• http://sensuapp.org/docs/0.12

• https://github.com/sensu

• http://sensuapp.org/support/

• https://metacpan.org/pod/Sensu::API::Client