Skip to content

Commit 8cda77a

Browse files
committed
readme update
1 parent c31e7bc commit 8cda77a

File tree

1 file changed

+84
-6
lines changed

1 file changed

+84
-6
lines changed

README.md

+84-6
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
11
# Sensu-Puppet
22

3-
This module is functional.
43

54
Tested with Travis CI
65

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

8+
## Upgrade note
9+
Version 0.5.0 is pretty close to 100% incompatible with previous version of the sensu-puppet module due to massive refactoring.
10+
911
## Installation
1012

1113
$ puppet module install sensu/sensu
1214

1315
## Prerequisites
16+
- redis server and connectivity to a redis database
17+
- rabbitmq server, vhost, and credentials
1418

15-
### Modules
19+
### Dependencies
1620

1721
- puppetlabs/apt
18-
- puppetlabs/rabbitmq
19-
- thomasvandoren/redis
2022

2123
See Modulefile for details.
2224

2325
### Others
2426

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

27-
## Example
30+
## Basic Example
2831

2932
### Sensu Server
3033

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

70+
### Advanced Example (hiera)
71+
This example includes the sensu class as part of a base class or role and controles sensu on each individual node via hiera.
72+
73+
hiera.yaml
74+
75+
---
76+
:hierarchy:
77+
- %{fqdn}
78+
- %{datacenter}
79+
- common
80+
:backends:
81+
- yaml
82+
:yaml:
83+
:datadir: '/etc/puppet/%{environment}/modules/hieradata'
84+
85+
common.yaml
86+
87+
sensu::dashboard_port: 8090
88+
sensu::dashboard_password: mysupersecretpassword
89+
sensu::install_repo: 'false'
90+
sensu::purge_config: true
91+
sensu::rabbitmq_host: 10.31.0.90
92+
sensu::rabbitmq_password: password
93+
sensu::rabbitmq_port: 5672
94+
95+
sensu-server.foo.com.yaml
96+
97+
sensu::server: true
98+
99+
nosensu.foo.com.yaml
100+
101+
sensu::client: 'false'
102+
103+
site.pp
104+
105+
node default {
106+
class { 'sensu': }
107+
...
108+
}
109+
110+
111+
### Inclusion of sensu monitoring in other modules
112+
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:
113+
114+
apache/manifests/monitoring/sensu.pp
115+
116+
class apache::monitoring::sensu {
117+
sensu::check { 'apache-running':
118+
handlers => 'default',
119+
command => '/etc/sensu/plugins/check-procs.rb -p /usr/sbin/httpd -w 100 -c 200 -C 1',
120+
refresh => 1800,
121+
standalone => true,
122+
}
123+
}
124+
125+
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:
126+
127+
apache/manifests/monitoring/sensu.pp
128+
129+
class apache::monitoring::sensu {
130+
sensu::subscription { 'apache' }
131+
}
132+
133+
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:
134+
135+
apache/manifests/service.pp
136+
137+
$monitoring = hiera('monitoring', '')
138+
139+
case $monitoring {
140+
'sensu': { include apache::monitoring::sensu }
141+
'nagios': { include apache::monitoring::nagios }
142+
}
143+
144+
67145
## License
68146

69147
MIT

0 commit comments

Comments
 (0)