henpecked 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.travis.yml +6 -0
- data/Gemfile +1 -0
- data/README.md +4 -0
- data/lib/henpecked/base.rb +3 -1
- data/lib/henpecked/push.rb +4 -4
- data/lib/henpecked/version.rb +1 -1
- data/spec/alerts_spec.rb +20 -0
- data/spec/spec_helper.rb +1 -0
- metadata +3 -2
data/.travis.yml
ADDED
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Heckpacked
|
2
2
|
Is a lightweight library for Icinga passive checks. It helps you raise alerts in very easy way in your application :)
|
3
3
|
|
4
|
+
## Travis
|
5
|
+
Ci status
|
6
|
+
[](http://travis-ci.org/JakubOboza/henpecked)
|
7
|
+
|
4
8
|
## Passive Checks
|
5
9
|
It is implementing passive checks
|
6
10
|
<http://docs.icinga.org/latest/en/passivechecks.html>
|
data/lib/henpecked/base.rb
CHANGED
data/lib/henpecked/push.rb
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
module Henpecked
|
2
2
|
|
3
3
|
def self.push(alert)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
raise Exception.new "Alert object has to have icinga_description method" unless alert.respond_to?(:icinga_description)
|
5
|
+
File.open(Henpecked.file_path, "a") do |file|
|
6
|
+
file.write(alert.icinga_description + "\n")
|
7
|
+
end
|
8
8
|
end
|
9
9
|
|
10
10
|
end
|
data/lib/henpecked/version.rb
CHANGED
data/spec/alerts_spec.rb
CHANGED
@@ -53,4 +53,24 @@ describe Henpecked do
|
|
53
53
|
test.command.should eql("TASTY_COOKIE;")
|
54
54
|
end
|
55
55
|
|
56
|
+
describe "alert classes" do
|
57
|
+
|
58
|
+
before(:each) do
|
59
|
+
Delorean.back_to_the_present
|
60
|
+
end
|
61
|
+
|
62
|
+
it "should have AcknowledgeHostProblem class" do
|
63
|
+
Henpecked::Alert::AcknowledgeHostProblem.new.icinga_description.should_not be_nil
|
64
|
+
Henpecked::Alert::AcknowledgeHostProblemExpire.new.icinga_description.should_not be_nil
|
65
|
+
Henpecked::Alert::SendCustomHostNotification.new.icinga_description.should_not be_nil
|
66
|
+
end
|
67
|
+
|
68
|
+
it "should create correct custom host notification" do
|
69
|
+
Delorean.time_travel_to "01/01/1985"
|
70
|
+
scn = Henpecked::Alert::SendCustomHostNotification.new(1,1,1,"Test Lol!")
|
71
|
+
scn.icinga_description.should eql("[473428800] SEND_CUSTOM_HOST_NOTIFICATION; 1;1;1;Test Lol!")
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
75
|
+
|
56
76
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: henpecked
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-05-
|
12
|
+
date: 2012-05-23 00:00:00.000000000Z
|
13
13
|
dependencies: []
|
14
14
|
description: This gem provides simple api to work with Icinga passive checks
|
15
15
|
email:
|
@@ -20,6 +20,7 @@ extra_rdoc_files: []
|
|
20
20
|
files:
|
21
21
|
- .gitignore
|
22
22
|
- .rspec
|
23
|
+
- .travis.yml
|
23
24
|
- Gemfile
|
24
25
|
- LICENSE
|
25
26
|
- README.md
|