README.markdown

Outpost

Features

Outpost is a tool to monitor the state of your service (not server). What does it mean?

It means:

it can monitor the state of a server, such as MySQL;

it can monitor some business rule to see if everything is running accordingly (such as cron jobs)

it can monitor several servers

it can monitor whatever you can code with Ruby

It will connect to the related machines (it won't have any proxies/agents running on the servers to
report data) and collect the data. The idea is to be completely uncoupled with the systems.
It should report a status per declared system.

The idea is to make a reliable framework for the Ruby developer to create his own monitoring rules.
So, summing it all up, Nagios in Ruby, much cooler!

In this simple example, an Outpost was created to monitor a web server running
on localhost at port 3000. Every time #run is called, the outpost will
run associated rules (in this example, check if the HTTP response code is 200
and report "up" if it does and also check if the response body matches /Ops/,
reporting "down" in that case).

Outpost

Outpost is the description of the system and provides a DSL to do it.
Check "How it works" section for an example, or check the integration tests
for more.

It must implement the #setup and #execute methods. The magic lies in the #execute
method, where you can implement any kind of logic to test whether your system is up
or not. You may also include expectations in order to process the output of your system.
For more information about expectations, check the section below.

If you're interested in the data the Scouts got through a measurement, you can
tell Outpost that it must save that data after the measurement is run. That way
you can inquiry it for further analysis. This way, you can have Scouts without
any expectations/reports, so you can collect data without telling if the system
is either up or down. You can check an usage example in the Reports
integration
test.

Expectations

In the example above, :response_code and :response_body are expectations, responsible
to get Scout's output and evaluate it, in order to determine a status.

They must be registered into each Scout that wish to support different types
of expectations. You can supply a block or an object that respond to #call
and return true if any of the rules match. It will receive an instance
of the scout (so you can query current system state) as the first parameter
and the state defined in the #report method as the second.

So you can easily create your own expectation. Let's recreate the :response_code in
Outpost::Scouts::Http: