riemann-babbler 1.3.9.1 → 1.3.9.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.
@@ -22,7 +22,7 @@ class Riemann::Babbler::Http < Riemann::Babbler
22
22
  command += " -w '%{http_code}\\n'"
23
23
  command += " --retry #{plugin.retry} --retry-delay #{plugin.retry_delay}"
24
24
  command += " --max-time #{plugin.max_time} --fail"
25
- command += " #{plugin.url} -o /dev/null || echo 500"
25
+ command += " #{plugin.url} -o /dev/null || echo 'mock exit status'"
26
26
 
27
27
  out = shell(command).to_i
28
28
 
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '1.3.9.1'
3
+ VERSION = '1.3.9.3'
4
4
  end
5
5
  end
@@ -24,7 +24,7 @@ module Riemann
24
24
  registered_plugins << klass
25
25
  end
26
26
 
27
- attr_reader :hostname, :has_last_error, :logger, :riemann
27
+ attr_reader :hostname, :has_last_error, :logger, :riemann, :has_last_error
28
28
  alias :r :riemann
29
29
 
30
30
  def initialize( configatron, logger, riemann )
@@ -33,6 +33,7 @@ module Riemann
33
33
  @riemann = riemann
34
34
  @storage = Hash.new
35
35
  @hostname = get_hostname
36
+ @has_last_error = false
36
37
  init
37
38
  plugin.set_default(:interval, configatron.riemann.interval)
38
39
  end
@@ -137,7 +138,10 @@ module Riemann
137
138
  error = true
138
139
  end
139
140
 
140
- report({:state => 'ok', :service => plugin.service + " plugin errors"}) if (not error && @has_last_error)
141
+ if (!error && @has_last_error)
142
+ report({:state => 'ok', :service => plugin.service + " plugin errors"})
143
+ end
144
+
141
145
  @has_last_error = error
142
146
  sleep(plugin.interval - ((Time.now - t0) % plugin.interval))
143
147
  end
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: 1.3.9.1
4
+ version: 1.3.9.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: 2013-10-09 00:00:00.000000000 Z
12
+ date: 2013-10-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riemann-client