kurchatov 0.2.2 → 0.2.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.
- checksums.yaml +4 -4
- data/CHANGELOG +2 -0
- data/lib/kurchatov/monitor.rb +4 -1
- data/lib/kurchatov/version.rb +1 -1
- data/tests/data/plugin_dont_start.rb +5 -0
- data/tests/data/plugin_with_errors.rb +8 -0
- data/tests/data/plugin_with_errors_with_count.rb +8 -0
- data/tests/server.rb +1 -1
- metadata +6 -3
- /data/tests/data/{sample.rb → plugin_sample.rb} +0 -0
- /data/tests/data/{required.rb → plugin_with_no_required.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbbbae27bc63fa4d288964473a0c40f7c5d287de
|
4
|
+
data.tar.gz: b7b563070302caaef9fccfd31b418327c32c13c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bf3a30e95ed5120216b5eca71954d66ddd4d66e2c8ba894d3fdb4b04530030fdd8143848a0351cc50694737450b08f2f6a69f8d62f76bd002afa706960baccc3
|
7
|
+
data.tar.gz: ec916fe27d1cdbd386e2854f1bcc2d620f265eaf4cb57a072cdc5383b97fb67eebb305d50007f7d595f0eb65a116714104bf1e57c6b49567551d39896c490422
|
data/CHANGELOG
CHANGED
data/lib/kurchatov/monitor.rb
CHANGED
@@ -12,6 +12,7 @@ module Kurchatov
|
|
12
12
|
@count_errors = 0
|
13
13
|
@last_error = nil
|
14
14
|
@last_error_at = nil
|
15
|
+
@last_error_count = 0
|
15
16
|
end
|
16
17
|
|
17
18
|
def name
|
@@ -34,15 +35,17 @@ module Kurchatov
|
|
34
35
|
return false if @thread.alive?
|
35
36
|
# thread died, join and extract error
|
36
37
|
begin
|
38
|
+
@last_error_count = 0
|
37
39
|
@thread.join # call error
|
38
40
|
rescue => e
|
39
41
|
desc = "Plugin '#{@plugin.name}' died. #{e.class}: #{e}\n." +
|
40
42
|
"Trace: #{e.backtrace.join("\n")}"
|
41
43
|
@count_errors += 1
|
44
|
+
@last_error_count += 1
|
42
45
|
@last_error = desc
|
43
46
|
@last_error_at = Time.now
|
44
47
|
Log.error(desc)
|
45
|
-
|
48
|
+
if @plugin.ignore_errors == false || (@plugin.ignore_errors.class == 'Fixnum' && @plugin.ignore_errors > @plugin.last_error_count)
|
46
49
|
event(:service => "plugin #{@plugin.name} errors", :desc => desc, :state => 'critical')
|
47
50
|
end
|
48
51
|
end
|
data/lib/kurchatov/version.rb
CHANGED
data/tests/server.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kurchatov
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vasiliev Dmitry
|
@@ -193,8 +193,11 @@ files:
|
|
193
193
|
- lib/ohai/plugins/windows/platform.rb
|
194
194
|
- tests/data/config.yml
|
195
195
|
- tests/data/event.yml
|
196
|
-
- tests/data/
|
197
|
-
- tests/data/
|
196
|
+
- tests/data/plugin_dont_start.rb
|
197
|
+
- tests/data/plugin_sample.rb
|
198
|
+
- tests/data/plugin_with_errors.rb
|
199
|
+
- tests/data/plugin_with_errors_with_count.rb
|
200
|
+
- tests/data/plugin_with_no_required.rb
|
198
201
|
- tests/run.sh
|
199
202
|
- tests/server.rb
|
200
203
|
- tests/testreceived.rb
|
File without changes
|
File without changes
|