b2b2dot0/fuey_client — pull request #2 by mattsnyder (2013-08-14 20:08:01+00:00)
Title: Group Inspections in Traces. A Trace stops inspecting once an inspection fails.

# v0.1.0
**This commit requires changing the config.yml to follow the new layout for `Trace`.**
This branch moves from just running all `Inspection` defined in the config.yml to grouping those `Inspection`s in `Trace`s. Each `Trace` will execute in sequence until it encounters an error.

## config.yml
Example:
```yml
---
title: "My app server"
logfile: /var/log/fuey.log
notifications:
-
- "run.trace"
- "Fuey::Log"
traces:
trace1:
- Ping:
name: Google
host: 8.8.8.8
- SNMPWalk:
name: "VPNTunnel"
ip: "98.31.121.10"
community: "public"
oid: "1.1.0.2.0.1.9.4.131.9.2.7.7.1"
version: "v1"
```
Multiple traces can be defined per yml file and are defined by a `Trace#name`. In this scenario the `Trace#name` is _trace1_. The order of `Inspection` is important. In this scenario the `Ping` will execute and then if it is successful it will perform the `SNMPWalk`.

Failure and success is reported to the log file as such:
```
[trace1] trace1 failed on VPN 1. 2 steps, 2 executed, 1 failed.
```
The number of steps, steps executed, and failures is always reported, even when everything was successful.

## Instrumentation
[ActiveSupport::Notifications](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html) were added and currently setup on `Trace#run`. You can configure how it is logged in the YAML file by defining a new class to subscribe to the `run.trace` event.