riemann-babbler 0.4.6 → 0.4.7
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/lib/riemann/babbler/plugin.rb +4 -1
- data/lib/riemann/babbler/plugins/cpu.rb +7 -1
- data/lib/riemann/version.rb +1 -1
- metadata +2 -2
@@ -49,7 +49,10 @@ module Riemann
|
|
49
49
|
|
50
50
|
def report(event)
|
51
51
|
report_with_diff(event) and return if event[:as_diff]
|
52
|
-
event[:state]
|
52
|
+
# если нет event[:state] то попробовать его добавить
|
53
|
+
unless event[:state]
|
54
|
+
event[:state] = state(event[:metric]) unless plugin.states.critical.nil?
|
55
|
+
end
|
53
56
|
event[:tags] = options.riemann.tags unless options.riemann.tags.nil?
|
54
57
|
event[:host] = host
|
55
58
|
logger.debug "Report status: #{event.inspect}"
|
@@ -13,7 +13,13 @@ class Riemann::Babbler::Cpu < Riemann::Babbler
|
|
13
13
|
end
|
14
14
|
|
15
15
|
@old_cpu = [u2, n2, s2, i2]
|
16
|
-
|
16
|
+
|
17
|
+
if @old_cpu
|
18
|
+
{ :service => plugin.service, :metric => fraction }
|
19
|
+
else
|
20
|
+
{ :service => plugin.service, :state => 'ok' }
|
21
|
+
end
|
22
|
+
|
17
23
|
end
|
18
24
|
|
19
25
|
end
|
data/lib/riemann/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: riemann-babbler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -147,7 +147,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
147
147
|
version: '0'
|
148
148
|
segments:
|
149
149
|
- 0
|
150
|
-
hash: -
|
150
|
+
hash: -143133632494635305
|
151
151
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
152
152
|
none: false
|
153
153
|
requirements:
|