flapjack 0.5.1 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. data/.gitignore +16 -0
  2. data/Rakefile +72 -32
  3. data/VERSION +1 -0
  4. data/bin/flapjack-netsaint-parser +433 -0
  5. data/bin/flapjack-populator +29 -0
  6. data/bin/flapjack-stats +10 -5
  7. data/{etc → dist/etc}/default/flapjack-notifier +0 -0
  8. data/{etc → dist/etc}/default/flapjack-workers +0 -0
  9. data/{etc → dist/etc}/flapjack/flapjack-notifier.conf.example +0 -0
  10. data/{etc → dist/etc}/flapjack/recipients.conf.example +0 -0
  11. data/{etc → dist/etc}/init.d/flapjack-notifier +0 -0
  12. data/{etc → dist/etc}/init.d/flapjack-workers +7 -7
  13. data/dist/puppet/flapjack/files/.stub +0 -0
  14. data/dist/puppet/flapjack/manifests/common.pp +61 -0
  15. data/dist/puppet/flapjack/manifests/notifier.pp +13 -0
  16. data/dist/puppet/flapjack/manifests/worker.pp +13 -0
  17. data/dist/puppet/flapjack/templates/.stub +0 -0
  18. data/dist/puppet/ruby/manifests/dev.pp +5 -0
  19. data/dist/puppet/ruby/manifests/rubygems.pp +14 -0
  20. data/dist/puppet/sqlite3/manifests/dev.pp +5 -0
  21. data/features/netsaint-config-converter.feature +126 -0
  22. data/features/steps/flapjack-importer_steps.rb +112 -0
  23. data/features/steps/flapjack-netsaint-parser_steps.rb +51 -0
  24. data/features/steps/flapjack-worker-manager_steps.rb +6 -8
  25. data/features/support/env.rb +22 -19
  26. data/flapjack.gemspec +186 -23
  27. data/lib/flapjack.rb +4 -0
  28. data/spec/check_sandbox/echo +3 -0
  29. data/spec/check_sandbox/sandboxed_check +5 -0
  30. data/spec/configs/flapjack-notifier-couchdb.ini +25 -0
  31. data/spec/configs/flapjack-notifier.ini +39 -0
  32. data/spec/configs/recipients.ini +14 -0
  33. data/spec/helpers.rb +15 -0
  34. data/spec/inifile_spec.rb +66 -0
  35. data/spec/mock-notifiers/mock/init.rb +3 -0
  36. data/spec/mock-notifiers/mock/mock.rb +19 -0
  37. data/spec/notifier-directories/spoons/testmailer/init.rb +20 -0
  38. data/spec/notifier_application_spec.rb +222 -0
  39. data/spec/notifier_filters_spec.rb +52 -0
  40. data/spec/notifier_options_multiplexer_spec.rb +71 -0
  41. data/spec/notifier_options_spec.rb +115 -0
  42. data/spec/notifier_spec.rb +57 -0
  43. data/spec/notifiers/mailer_spec.rb +36 -0
  44. data/spec/notifiers/xmpp_spec.rb +36 -0
  45. data/spec/persistence/datamapper_spec.rb +74 -0
  46. data/spec/persistence/mock_persistence_backend.rb +26 -0
  47. data/spec/simple.ini +6 -0
  48. data/spec/spec.opts +4 -0
  49. data/spec/test-filters/blocker.rb +13 -0
  50. data/spec/test-filters/mock.rb +13 -0
  51. data/spec/transports/beanstalkd_spec.rb +44 -0
  52. data/spec/transports/mock_transport.rb +58 -0
  53. data/spec/worker_application_spec.rb +62 -0
  54. data/spec/worker_options_spec.rb +83 -0
  55. metadata +166 -47
@@ -0,0 +1,51 @@
1
+ Given /^NetSaint configuration is at "([^"]*)"$/ do |path|
2
+ require 'pathname'
3
+ root = Pathname.new(path)
4
+ files = []
5
+ files << root.join('commands.cfg')
6
+ files << root.join('netsaint.cfg')
7
+ files << root.join('resource.cfg')
8
+
9
+ File.directory?(root).should be_true
10
+ files.each do |filename|
11
+ File.exists?(filename).should be_true
12
+ end
13
+ end
14
+
15
+ Then /^I should see a valid JSON output$/ do
16
+ lambda {
17
+ parser = Yajl::Parser.new
18
+ @data = parser.parse(@output)
19
+ }.should_not raise_error
20
+ end
21
+
22
+ Then /^show me the output$/ do
23
+ puts @output
24
+ end
25
+
26
+ Then /^I should see a list of (\w+)$/ do |type|
27
+ @data[type].should_not be_nil
28
+ @data[type].size.should > 0
29
+ end
30
+
31
+ Then /^I should see the following attributes for every (\w+):$/ do |type, table|
32
+ type += 's'
33
+ values = table.hashes.find_all {|h| !h.key?("nillable?") }.map {|h| h["attribute"] }
34
+ @data[type].each_pair do |name, items|
35
+ items.each do |item|
36
+ values.each do |attr|
37
+ item[attr].should_not be_nil
38
+ end
39
+ end
40
+ end
41
+
42
+ nils = table.hashes.find_all {|h| h.key?("nillable?") }.map {|h| h["attribute"] }
43
+ @data[type].each_pair do |name, items|
44
+ items.each do |item|
45
+ nils.each do |attr|
46
+ item.member?(attr).should be_true
47
+ end
48
+ end
49
+ end
50
+ end
51
+
@@ -12,18 +12,16 @@ Given /^the "([^\"]*)" directory exists and is writable$/ do |directory|
12
12
  end
13
13
 
14
14
  When /^I run "([^\"]*)"$/ do |cmd|
15
- parts = [cmd]
16
- parts.unshift(@bin_path) if @bin_path
17
- command = parts.join('/')
18
- # this might be dodgy
15
+ @root = Pathname.new(File.dirname(__FILE__)).parent.parent.expand_path
16
+ bin_path = @root.join('bin')
17
+ command = "#{bin_path}/#{cmd}"
18
+
19
19
  @output = `#{command}`
20
- #@output.size.should > 0
21
- #p command
22
- #p @output
20
+ $?.exitstatus.should == 0
23
21
  end
24
22
 
25
23
  Then /^(\d+) instances of "([^\"]*)" should be running$/ do |number, command|
26
- sleep 0.5 # this truly is a dodgy hack.
24
+ sleep 0.5 # this truly is a dodgy hack.
27
25
  # sometimes the the worker manager can take a while to fork
28
26
  output = `ps -eo cmd |grep ^#{command} |grep -v grep`
29
27
  output.split.size.should >= number.to_i
@@ -1,22 +1,25 @@
1
- #!/usr/bin/env ruby
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  $: << File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'lib'))
4
4
 
5
- require 'flapjack/inifile'
6
- require 'flapjack/filters/ok'
7
- require 'flapjack/filters/any_parents_failed'
8
- require 'flapjack/notifier_engine'
9
- require 'flapjack/transports/result'
10
- require 'flapjack/transports/beanstalkd'
11
- require 'flapjack/patches'
12
- require 'flapjack/inifile'
13
- require 'flapjack/cli/worker_manager'
14
- require 'flapjack/cli/notifier_manager'
15
- require 'flapjack/cli/notifier'
16
- require 'flapjack/cli/worker'
17
- require 'flapjack/persistence/couch'
18
- require 'flapjack/persistence/sqlite3'
19
- require 'flapjack/applications/notifier'
20
- require 'flapjack/applications/worker'
21
- require 'flapjack/notifiers/mailer/init'
22
- require 'flapjack/notifiers/xmpp/init'
5
+ require 'yajl'
6
+ require 'beanstalk-client'
7
+
8
+ #require 'flapjack/inifile'
9
+ #require 'flapjack/filters/ok'
10
+ #require 'flapjack/filters/any_parents_failed'
11
+ #require 'flapjack/notifier_engine'
12
+ #require 'flapjack/transports/result'
13
+ #require 'flapjack/transports/beanstalkd'
14
+ #require 'flapjack/patches'
15
+ #require 'flapjack/inifile'
16
+ #require 'flapjack/cli/worker_manager'
17
+ #require 'flapjack/cli/notifier_manager'
18
+ #require 'flapjack/cli/notifier'
19
+ #require 'flapjack/cli/worker'
20
+ #require 'flapjack/persistence/couch'
21
+ #require 'flapjack/persistence/sqlite3'
22
+ #require 'flapjack/applications/notifier'
23
+ #require 'flapjack/applications/worker'
24
+ #require 'flapjack/notifiers/mailer/init'
25
+ #require 'flapjack/notifiers/xmpp/init'
data/flapjack.gemspec CHANGED
@@ -1,27 +1,190 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE DIRECTLY
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
+ # -*- encoding: utf-8 -*-
5
+
1
6
  Gem::Specification.new do |s|
2
- s.name = 'flapjack'
3
- s.version = '0.5.1'
4
- s.date = '2010-02-28'
5
-
6
- s.summary = "a scalable and distributed monitoring system"
7
- s.description = "Flapjack is highly scalable and distributed monitoring system. It understands the Nagios plugin format, and can easily be scaled from 1 server to 1000."
8
-
9
- s.authors = ['Lindsay Holmwood']
10
- s.email = 'lindsay@holmwood.id.au'
11
- s.homepage = 'http://flapjack-project.com'
12
- s.has_rdoc = false
7
+ s.name = %q{flapjack}
8
+ s.version = "0.5.3"
13
9
 
14
- s.add_dependency('daemons', '= 1.0.10')
15
- s.add_dependency('beanstalk-client', '= 1.0.2')
16
- s.add_dependency('log4r', '= 1.1.5')
17
- s.add_dependency('xmpp4r', '= 0.5')
18
- s.add_dependency('tmail', '= 1.2.3.1')
19
- s.add_dependency('yajl-ruby', '= 0.6.4')
20
- s.add_dependency('sqlite3-ruby', '= 1.2.5')
21
-
22
- s.bindir = "bin"
23
- s.executables = ["flapjack-benchmark", "flapjack-notifier", "flapjack-notifier-manager", "flapjack-stats", "flapjack-worker", "flapjack-worker-manager", "install-flapjack-systemwide" ]
24
- s.files = ["LICENCE", "README.md", "Rakefile", "TODO.md", "bin/flapjack-benchmark", "bin/flapjack-notifier", "bin/flapjack-notifier-manager", "bin/flapjack-stats", "bin/flapjack-worker", "bin/flapjack-worker-manager", "bin/install-flapjack-systemwide", "doc/CONFIGURING.md", "doc/DEVELOPING.md", "doc/INSTALL.md", "doc/PACKAGING.md", "etc/default/flapjack-notifier", "etc/default/flapjack-workers", "etc/flapjack/flapjack-notifier.conf.example", "etc/flapjack/recipients.conf.example", "etc/init.d/flapjack-notifier", "etc/init.d/flapjack-workers", "features/flapjack-notifier-manager.feature", "features/flapjack-worker-manager.feature", "features/packaging-lintian.feature", "features/persistence/couch.feature", "features/persistence/sqlite3.feature", "features/persistence/steps/couch_steps.rb", "features/persistence/steps/generic_steps.rb", "features/persistence/steps/sqlite3_steps.rb", "features/steps/flapjack-notifier-manager_steps.rb", "features/steps/flapjack-worker-manager_steps.rb", "features/steps/packaging-lintian_steps.rb", "features/support/env.rb", "features/support/silent_system.rb", "flapjack.gemspec", "lib/flapjack/applications/notifier.rb", "lib/flapjack/applications/worker.rb", "lib/flapjack/checks/http_content", "lib/flapjack/checks/ping", "lib/flapjack/cli/notifier.rb", "lib/flapjack/cli/notifier_manager.rb", "lib/flapjack/cli/worker.rb", "lib/flapjack/cli/worker_manager.rb", "lib/flapjack/filters/any_parents_failed.rb", "lib/flapjack/filters/ok.rb", "lib/flapjack/inifile.rb", "lib/flapjack/notifier_engine.rb", "lib/flapjack/notifiers/mailer/init.rb", "lib/flapjack/notifiers/mailer/mailer.rb", "lib/flapjack/notifiers/xmpp/init.rb", "lib/flapjack/notifiers/xmpp/xmpp.rb", "lib/flapjack/patches.rb", "lib/flapjack/persistence/couch.rb", "lib/flapjack/persistence/couch/connection.rb", "lib/flapjack/persistence/couch/couch.rb", "lib/flapjack/persistence/data_mapper.rb", "lib/flapjack/persistence/data_mapper/data_mapper.rb", "lib/flapjack/persistence/data_mapper/models/check.rb", "lib/flapjack/persistence/data_mapper/models/check_template.rb", "lib/flapjack/persistence/data_mapper/models/event.rb", "lib/flapjack/persistence/data_mapper/models/node.rb", "lib/flapjack/persistence/data_mapper/models/related_check.rb", "lib/flapjack/persistence/sqlite3.rb", "lib/flapjack/persistence/sqlite3/sqlite3.rb", "lib/flapjack/transports/beanstalkd.rb", "lib/flapjack/transports/result.rb"]
25
- end
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Lindsay Holmwood"]
12
+ s.date = %q{2011-01-14}
13
+ s.description = %q{lapjack is highly scalable and distributed monitoring system. It understands the Nagios plugin format, and can easily be scaled from 1 server to 1000.}
14
+ s.email = %q{lindsay@holmwood.id.au}
15
+ s.executables = ["flapjack-benchmark", "flapjack-netsaint-parser", "flapjack-notifier", "flapjack-notifier-manager", "flapjack-populator", "flapjack-stats", "flapjack-worker", "flapjack-worker-manager", "install-flapjack-systemwide"]
16
+ s.extra_rdoc_files = [
17
+ "README.md"
18
+ ]
19
+ s.files = [
20
+ ".gitignore",
21
+ "LICENCE",
22
+ "README.md",
23
+ "Rakefile",
24
+ "TODO.md",
25
+ "VERSION",
26
+ "bin/flapjack-benchmark",
27
+ "bin/flapjack-netsaint-parser",
28
+ "bin/flapjack-notifier",
29
+ "bin/flapjack-notifier-manager",
30
+ "bin/flapjack-populator",
31
+ "bin/flapjack-stats",
32
+ "bin/flapjack-worker",
33
+ "bin/flapjack-worker-manager",
34
+ "bin/install-flapjack-systemwide",
35
+ "dist/etc/default/flapjack-notifier",
36
+ "dist/etc/default/flapjack-workers",
37
+ "dist/etc/flapjack/flapjack-notifier.conf.example",
38
+ "dist/etc/flapjack/recipients.conf.example",
39
+ "dist/etc/init.d/flapjack-notifier",
40
+ "dist/etc/init.d/flapjack-workers",
41
+ "dist/puppet/flapjack/files/.stub",
42
+ "dist/puppet/flapjack/manifests/common.pp",
43
+ "dist/puppet/flapjack/manifests/notifier.pp",
44
+ "dist/puppet/flapjack/manifests/worker.pp",
45
+ "dist/puppet/flapjack/templates/.stub",
46
+ "dist/puppet/ruby/manifests/dev.pp",
47
+ "dist/puppet/ruby/manifests/rubygems.pp",
48
+ "dist/puppet/sqlite3/manifests/dev.pp",
49
+ "doc/CONFIGURING.md",
50
+ "doc/DEVELOPING.md",
51
+ "doc/INSTALL.md",
52
+ "doc/PACKAGING.md",
53
+ "features/flapjack-notifier-manager.feature",
54
+ "features/flapjack-worker-manager.feature",
55
+ "features/netsaint-config-converter.feature",
56
+ "features/packaging-lintian.feature",
57
+ "features/persistence/couch.feature",
58
+ "features/persistence/sqlite3.feature",
59
+ "features/persistence/steps/couch_steps.rb",
60
+ "features/persistence/steps/generic_steps.rb",
61
+ "features/persistence/steps/sqlite3_steps.rb",
62
+ "features/steps/flapjack-importer_steps.rb",
63
+ "features/steps/flapjack-netsaint-parser_steps.rb",
64
+ "features/steps/flapjack-notifier-manager_steps.rb",
65
+ "features/steps/flapjack-worker-manager_steps.rb",
66
+ "features/steps/packaging-lintian_steps.rb",
67
+ "features/support/env.rb",
68
+ "features/support/silent_system.rb",
69
+ "features/support/tmp/.stub",
70
+ "flapjack.gemspec",
71
+ "lib/flapjack.rb",
72
+ "lib/flapjack/applications/notifier.rb",
73
+ "lib/flapjack/applications/worker.rb",
74
+ "lib/flapjack/checks/http_content",
75
+ "lib/flapjack/checks/ping",
76
+ "lib/flapjack/cli/notifier.rb",
77
+ "lib/flapjack/cli/notifier_manager.rb",
78
+ "lib/flapjack/cli/worker.rb",
79
+ "lib/flapjack/cli/worker_manager.rb",
80
+ "lib/flapjack/filters/any_parents_failed.rb",
81
+ "lib/flapjack/filters/ok.rb",
82
+ "lib/flapjack/inifile.rb",
83
+ "lib/flapjack/notifier_engine.rb",
84
+ "lib/flapjack/notifiers/mailer/init.rb",
85
+ "lib/flapjack/notifiers/mailer/mailer.rb",
86
+ "lib/flapjack/notifiers/xmpp/init.rb",
87
+ "lib/flapjack/notifiers/xmpp/xmpp.rb",
88
+ "lib/flapjack/patches.rb",
89
+ "lib/flapjack/persistence/couch.rb",
90
+ "lib/flapjack/persistence/couch/connection.rb",
91
+ "lib/flapjack/persistence/couch/couch.rb",
92
+ "lib/flapjack/persistence/data_mapper.rb",
93
+ "lib/flapjack/persistence/data_mapper/data_mapper.rb",
94
+ "lib/flapjack/persistence/data_mapper/models/check.rb",
95
+ "lib/flapjack/persistence/data_mapper/models/check_template.rb",
96
+ "lib/flapjack/persistence/data_mapper/models/event.rb",
97
+ "lib/flapjack/persistence/data_mapper/models/node.rb",
98
+ "lib/flapjack/persistence/data_mapper/models/related_check.rb",
99
+ "lib/flapjack/persistence/sqlite3.rb",
100
+ "lib/flapjack/persistence/sqlite3/sqlite3.rb",
101
+ "lib/flapjack/transports/beanstalkd.rb",
102
+ "lib/flapjack/transports/result.rb",
103
+ "spec/check_sandbox/echo",
104
+ "spec/check_sandbox/sandboxed_check",
105
+ "spec/configs/flapjack-notifier-couchdb.ini",
106
+ "spec/configs/flapjack-notifier.ini",
107
+ "spec/configs/recipients.ini",
108
+ "spec/helpers.rb",
109
+ "spec/inifile_spec.rb",
110
+ "spec/mock-notifiers/mock/init.rb",
111
+ "spec/mock-notifiers/mock/mock.rb",
112
+ "spec/notifier-directories/spoons/testmailer/init.rb",
113
+ "spec/notifier_application_spec.rb",
114
+ "spec/notifier_filters_spec.rb",
115
+ "spec/notifier_options_multiplexer_spec.rb",
116
+ "spec/notifier_options_spec.rb",
117
+ "spec/notifier_spec.rb",
118
+ "spec/notifiers/mailer_spec.rb",
119
+ "spec/notifiers/xmpp_spec.rb",
120
+ "spec/persistence/datamapper_spec.rb",
121
+ "spec/persistence/mock_persistence_backend.rb",
122
+ "spec/simple.ini",
123
+ "spec/spec.opts",
124
+ "spec/test-filters/blocker.rb",
125
+ "spec/test-filters/mock.rb",
126
+ "spec/transports/beanstalkd_spec.rb",
127
+ "spec/transports/mock_transport.rb",
128
+ "spec/worker_application_spec.rb",
129
+ "spec/worker_options_spec.rb"
130
+ ]
131
+ s.homepage = %q{http://flapjack-project.com/}
132
+ s.rdoc_options = ["--charset=UTF-8"]
133
+ s.require_paths = ["lib"]
134
+ s.rubygems_version = %q{1.3.7}
135
+ s.summary = %q{a scalable and distributed monitoring system}
136
+ s.test_files = [
137
+ "spec/helpers.rb",
138
+ "spec/inifile_spec.rb",
139
+ "spec/mock-notifiers/mock/init.rb",
140
+ "spec/mock-notifiers/mock/mock.rb",
141
+ "spec/notifier-directories/spoons/testmailer/init.rb",
142
+ "spec/notifier_application_spec.rb",
143
+ "spec/notifier_filters_spec.rb",
144
+ "spec/notifier_options_multiplexer_spec.rb",
145
+ "spec/notifier_options_spec.rb",
146
+ "spec/notifier_spec.rb",
147
+ "spec/notifiers/mailer_spec.rb",
148
+ "spec/notifiers/xmpp_spec.rb",
149
+ "spec/persistence/datamapper_spec.rb",
150
+ "spec/persistence/mock_persistence_backend.rb",
151
+ "spec/test-filters/blocker.rb",
152
+ "spec/test-filters/mock.rb",
153
+ "spec/transports/beanstalkd_spec.rb",
154
+ "spec/transports/mock_transport.rb",
155
+ "spec/worker_application_spec.rb",
156
+ "spec/worker_options_spec.rb"
157
+ ]
26
158
 
159
+ if s.respond_to? :specification_version then
160
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
161
+ s.specification_version = 3
162
+
163
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
164
+ s.add_runtime_dependency(%q<daemons>, ["= 1.0.10"])
165
+ s.add_runtime_dependency(%q<beanstalk-client>, ["= 1.0.2"])
166
+ s.add_runtime_dependency(%q<log4r>, ["= 1.1.5"])
167
+ s.add_runtime_dependency(%q<xmpp4r>, ["= 0.5"])
168
+ s.add_runtime_dependency(%q<tmail>, ["= 1.2.3.1"])
169
+ s.add_runtime_dependency(%q<yajl-ruby>, ["= 0.6.4"])
170
+ s.add_runtime_dependency(%q<sqlite3-ruby>, ["= 1.2.5"])
171
+ else
172
+ s.add_dependency(%q<daemons>, ["= 1.0.10"])
173
+ s.add_dependency(%q<beanstalk-client>, ["= 1.0.2"])
174
+ s.add_dependency(%q<log4r>, ["= 1.1.5"])
175
+ s.add_dependency(%q<xmpp4r>, ["= 0.5"])
176
+ s.add_dependency(%q<tmail>, ["= 1.2.3.1"])
177
+ s.add_dependency(%q<yajl-ruby>, ["= 0.6.4"])
178
+ s.add_dependency(%q<sqlite3-ruby>, ["= 1.2.5"])
179
+ end
180
+ else
181
+ s.add_dependency(%q<daemons>, ["= 1.0.10"])
182
+ s.add_dependency(%q<beanstalk-client>, ["= 1.0.2"])
183
+ s.add_dependency(%q<log4r>, ["= 1.1.5"])
184
+ s.add_dependency(%q<xmpp4r>, ["= 0.5"])
185
+ s.add_dependency(%q<tmail>, ["= 1.2.3.1"])
186
+ s.add_dependency(%q<yajl-ruby>, ["= 0.6.4"])
187
+ s.add_dependency(%q<sqlite3-ruby>, ["= 1.2.5"])
188
+ end
189
+ end
27
190
 
data/lib/flapjack.rb ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ module Flapjack
4
+ end
@@ -0,0 +1,3 @@
1
+ #!/bin/sh
2
+
3
+ echo $*
@@ -0,0 +1,5 @@
1
+ #!/bin/sh
2
+
3
+ # either of these should produce an ok result
4
+ echo $0
5
+ pwd
@@ -0,0 +1,25 @@
1
+ # top level
2
+ [notifier]
3
+ notifier-directories = /usr/lib/flapjack/notifiers/ /path/to/my/notifiers
4
+ notifiers = mailer, xmpp
5
+
6
+ [persistence]
7
+ backend = couchdb
8
+ version = 0.8
9
+ host = localhost
10
+ port = 5984
11
+ database = flapjack_production
12
+
13
+ [transport]
14
+ backend = beanstalkd
15
+ basedir = /usr/lib/flapjack/persistence/
16
+ host = localhost
17
+ port = 11300
18
+
19
+ [mailer-notifier]
20
+ from_address = foo@bar.com
21
+
22
+ [xmpp-notifier]
23
+ jid = foo@bar.com
24
+ password = barfoo
25
+
@@ -0,0 +1,39 @@
1
+ # top level
2
+ [notifier]
3
+ notifier-directories = /usr/lib/flapjack/notifiers/ /path/to/my/notifiers
4
+ notifiers = mailer, xmpp
5
+
6
+ # persistence layers
7
+ [persistence]
8
+ backend = data_mapper
9
+ uri = sqlite3:///tmp/flapjack.db
10
+
11
+ # message transports
12
+ [transport]
13
+ backend = beanstalkd
14
+ host = localhost
15
+ port = 11300
16
+
17
+ # notifiers
18
+ [mailer-notifier]
19
+ from_address = foo@bar.com
20
+
21
+ [xmpp-notifier]
22
+ jid = foo@bar.com
23
+ password = barfoo
24
+
25
+ # filters
26
+ [filters]
27
+ chain = ok, downtime, any_parents_failed
28
+
29
+ #[pre-filters-actions]
30
+ # chain =
31
+ #
32
+ #[post-filters-actions]
33
+ # chain =
34
+ #
35
+ #[pre-notification-actions]
36
+ # chain =
37
+ #
38
+ #[post-notification-actions]
39
+ # chain =
@@ -0,0 +1,14 @@
1
+ # recipients
2
+
3
+ [John Doe]
4
+ email = johndoe@example.org
5
+ jid = john@example.org
6
+ phone = +61 400 111 222
7
+ pager = 61400111222
8
+
9
+ [Jane Doe]
10
+ email = janedoe@example.org
11
+ jid = jane@example.org
12
+ phone = +61 222 333 111
13
+ pager = 61222333111
14
+
data/spec/helpers.rb ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+
4
+ class MockLogger
5
+ attr_reader :messages
6
+ %w(warning error info debug).each do |type|
7
+ class_eval <<-HERE
8
+ def #{type}(message)
9
+ @messages ||= []
10
+ @messages << message
11
+ end
12
+ HERE
13
+ end
14
+ end
15
+