Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
jlambert121 committed Mar 21, 2013
1 parent c31e7bc commit 8cda77a
Showing 1 changed file with 84 additions and 6 deletions.
90 changes: 84 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
# Sensu-Puppet

This module is functional.

Tested with Travis CI

[![Build Status](https://travis-ci.org/sensu/sensu-puppet.png)](https://travis-ci.org/sensu/sensu-puppet)

## Upgrade note
Version 0.5.0 is pretty close to 100% incompatible with previous version of the sensu-puppet module due to massive refactoring.

## Installation

$ puppet module install sensu/sensu

## Prerequisites
- redis server and connectivity to a redis database
- rabbitmq server, vhost, and credentials

### Modules
### Dependencies

- puppetlabs/apt
- puppetlabs/rabbitmq
- thomasvandoren/redis

See Modulefile for details.

### Others

Pluginsync should be enabled. Also, you need ruby json library/gem on all your nodes.
Pluginsync should be enabled. Also, you need ruby json library/gem on all your nodes.
[EPEL](http://mirrors.kernel.org/fedora-epel/6/x86_64/rubygem-json-1.4.6-1.el6.x86_64.rpm)

## Example
## Basic Example

### Sensu Server

Expand Down Expand Up @@ -64,6 +67,81 @@ Pluginsync should be enabled. Also, you need ruby json library/gem on all your n
}
}

### Advanced Example (hiera)
This example includes the sensu class as part of a base class or role and controles sensu on each individual node via hiera.

hiera.yaml

---
:hierarchy:
- %{fqdn}
- %{datacenter}
- common
:backends:
- yaml
:yaml:
:datadir: '/etc/puppet/%{environment}/modules/hieradata'

common.yaml

sensu::dashboard_port: 8090
sensu::dashboard_password: mysupersecretpassword
sensu::install_repo: 'false'
sensu::purge_config: true
sensu::rabbitmq_host: 10.31.0.90
sensu::rabbitmq_password: password
sensu::rabbitmq_port: 5672

sensu-server.foo.com.yaml

sensu::server: true

nosensu.foo.com.yaml

sensu::client: 'false'

site.pp

node default {
class { 'sensu': }
...
}


### Inclusion of sensu monitoring in other modules
There are a few different patterns that can be used to include sensu monitoring into other modules. One pattern creates a new class that is included as part of the host or node definition and includes a standalone check, for example:

apache/manifests/monitoring/sensu.pp

class apache::monitoring::sensu {
sensu::check { 'apache-running':
handlers => 'default',
command => '/etc/sensu/plugins/check-procs.rb -p /usr/sbin/httpd -w 100 -c 200 -C 1',
refresh => 1800,
standalone => true,
}
}

Rather than include a standalone check you could also include subscription information and let the sensu server schedule checks for this service as a subscriber:

apache/manifests/monitoring/sensu.pp

class apache::monitoring::sensu {
sensu::subscription { 'apache' }
}

If you would like to automatically include the sensu monitoring class as part of your existing module with the ability to support different monitoring platforms, you could do something like:

apache/manifests/service.pp

$monitoring = hiera('monitoring', '')

case $monitoring {
'sensu': { include apache::monitoring::sensu }
'nagios': { include apache::monitoring::nagios }
}


## License

MIT
Expand Down

0 comments on commit 8cda77a

Please sign in to comment.