Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 158 lines (133 sloc) 3.524 kB
059b9c2 @SarahKowalik Allow a different repository to be selected
SarahKowalik authored
1
f0fdbcd @auxesis Initial import of module
auxesis authored
2 Exec { path => '/usr/bin:/usr/sbin:/bin:/sbin' }
3
4 node default {
3785a8b @SarahKowalik Support debian
SarahKowalik authored
5 if $operatingsystem in [ 'Ubuntu', 'Debian' ] {
727944a @SarahKowalik Get Nagios and Icinga working under puppet for Centos and RHEL
SarahKowalik authored
6 class { 'apt':
7 always_apt_update => true,
47a2f2f @SarahKowalik Fix up config files, start supporting debian and more of centos
SarahKowalik authored
8 before => Class['nagios']
727944a @SarahKowalik Get Nagios and Icinga working under puppet for Centos and RHEL
SarahKowalik authored
9 }
10 }
11 elsif $operatingsystem in [ 'CentOS', 'RedHat' ] {
12 include epel
13 include repoforge
14 }
15 else {
16 fail 'Everything else unsupported'
e35cef0 @SarahKowalik Get puppet running again
SarahKowalik authored
17 }
18
f949c74 @jessereynolds rabbitmq, redis and sensu now install and run
jessereynolds authored
19 $ruby_json = $operatingsystem ? {
20 /(Ubuntu|Debian)/ => 'ruby-json',
21 /(CentOS|RedHat)/ => 'rubygem-json',
22 default => 'ruby-json',
23 }
24
e35cef0 @SarahKowalik Get puppet running again
SarahKowalik authored
25 package { 'curl':
26 ensure => present
27 } ->
28
f436ea3 @SarahKowalik Add mailcatcher to vagrant-flapjack, update specs (closes #1)
SarahKowalik authored
29 class { 'mailcatcher': }
30 class { 'nagios': } ->
31 class { 'icinga': } ->
32 class { 'flapjack': }
643aa49 @jessereynolds add ruby 1.9.3, flapjack-diner and pry ruby gems
jessereynolds authored
33
727944a @SarahKowalik Get Nagios and Icinga working under puppet for Centos and RHEL
SarahKowalik authored
34 if $tutorial_mode == 'true' {
f436ea3 @SarahKowalik Add mailcatcher to vagrant-flapjack, update specs (closes #1)
SarahKowalik authored
35 class { 'flapjack-diner': }
80f6e9c @jessereynolds fix syntax error
jessereynolds authored
36 }
f0fdbcd @auxesis Initial import of module
auxesis authored
37
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
38 if $with_sensu == 'true' {
6d1e90a @SarahKowalik Only run the sensu tests if sensu has been installed
SarahKowalik authored
39 file { '/tmp/include_sensu_tests':
40 ensure => present,
41 }
42
43
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
44 class { 'rabbitmq':
45 } ->
46
47 rabbitmq_vhost { '/sensu':
48 ensure => present,
49 } ->
50
51 rabbitmq_user { 'admin':
52 admin => true,
53 password => 'frostyfruit5',
54 } ->
55
56 rabbitmq_user { 'sensu':
57 admin => true,
58 password => 'tangymango5',
59 } ->
60
61 rabbitmq_user_permissions { 'sensu@/sensu':
62 configure_permission => '.*',
63 read_permission => '.*',
64 write_permission => '.*',
65 } ->
66
67 package { $ruby_json:
68 ensure => present
69 } ->
70
71 class { 'redis': } ->
72
73 class { 'sensu':
74 install_repo => true,
75 server => true,
76 manage_services => true,
77 manage_user => true,
78 rabbitmq_password => 'tangymango5',
79 rabbitmq_vhost => '/sensu',
80 api => true,
81 api_user => 'admin',
82 api_password => 'secret',
83 client_address => $::ipaddress_eth0,
84 #plugins => [
85 # 'puppet:///data/sensu/plugins/ntp.rb',
86 #]
87 }
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
88
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
89 sensu::handler { 'default':
90 command => 'mail -s \'sensu alert\' ops@example',
91 }
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
92
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
93 sensu::check { 'check_ntp':
94 command => 'PATH=$PATH:/usr/lib/nagios/plugins check_ntp_time -H pool.ntp.org -w 30 -c 60',
95 handlers => 'default',
96 subscribers => 'sensu-test',
97 type => 'metric',
98 }
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
99
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
100 sensu::check { 'check_flapper':
101 command => "PATH=$PATH:/usr/lib/nagios/plugins check_tcp -H ${::ipaddress_eth0} -p 12345",
102 interval => 5,
103 handlers => 'flapjack',
104 standalone => true,
105 type => 'metric',
106 }
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
107
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
108 sensu::extension { 'flapjack':
109 source => 'puppet:///modules/sensu/extensions/handlers/flapjack.rb',
110 config => {
111 'host' => 'localhost',
112 'port' => '6380',
113 'db' => '0',
114 }
115 }
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
116
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
117 # Installs the uchiwa dashboard for sensu
118 # 0.0.0.0:3000
119 # uchiwa, uchiwa
120
121 package { 'uchiwa':
122 ensure => present,
123 } ->
124
125 file { '/etc/sensu/uchiwa.json':
126 ensure => present,
127 content => '
128 {
129 "sensu": [
130 {
131 "name": "Site1",
132 "host": "localhost",
133 "port": 4567,
134 "timeout": 5,
135 "user": "admin",
136 "pass": "secret"
137 }
138 ],
139 "uchiwa": {
140 "host": "0.0.0.0",
141 "port": 3000,
142 "user": "uchiwa",
143 "pass": "uchiwa",
144 "interval": 5
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
145 }
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
146 }',
147 require => Package['uchiwa'],
148 notify => Service['uchiwa'],
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
149 }
150
c083064 @jessereynolds don't install sensu by default, improve doco
jessereynolds authored
151 service { 'uchiwa':
152 ensure => running,
153 enable => true,
154 require => [ File['/etc/sensu/uchiwa.json'],Package['uchiwa'] ]
155 }
71e26a3 @jessereynolds got sensu working and sending events to flapjack
jessereynolds authored
156 }
f0fdbcd @auxesis Initial import of module
auxesis authored
157 }
Something went wrong with that request. Please try again.