riemann-babbler 1.0.5.7 → 1.0.6

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.
@@ -0,0 +1,22 @@
1
+ require 'json'
2
+
3
+ class Riemann::Babbler::Je < Riemann::Babbler
4
+
5
+ def init
6
+ plugin.set_default(:service, 'je')
7
+ plugin.set_default(:interval, 60)
8
+ plugin.set_default(:url, 'http://localhost/status')
9
+ plugin.states.set_default(:critical, 10)
10
+ end
11
+
12
+ def collect
13
+ array = Array.new
14
+ JSON.parse( rest_get( plugin.url ) ).each do |channel|
15
+ timing = unixnow - channel['moment'].to_i
16
+ sid = channel['sid']
17
+ array << { :service => plugin.service + " status #{sid}", :metric => timing.to_i, :description => "Je timming sid #{sid}, in sec." }
18
+ end
19
+ array
20
+ end
21
+
22
+ end
@@ -0,0 +1,26 @@
1
+ require 'json'
2
+
3
+ class Riemann::Babbler::Sdigrabber < Riemann::Babbler
4
+
5
+ def init
6
+ plugin.set_default(:service, 'sdigrabber')
7
+ plugin.set_default(:interval, 60)
8
+ plugin.set_default(:url, 'http://localhost/status')
9
+ plugin.states.set_default(:critical, 10)
10
+ end
11
+
12
+ def collect
13
+ array = Array.new
14
+ JSON.parse( rest_get( plugin.url ) ).each do |box|
15
+ box['processors'].each do |processor, processor_options|
16
+ next unless processor =~ /Proc\s+encoder/
17
+ next unless processor_options['setup']['last-unit-pts']
18
+ timing = unixnow - processor_options['setup']['last-unit-pts'].to_i
19
+ cid = processor_options['setup']['cid']
20
+ array << { :service => plugin.service + " status #{cid}", :metric => timing.to_i, :description => "Sdigrabber timming cid #{cid}" }
21
+ end
22
+ end
23
+ array
24
+ end
25
+
26
+ end
@@ -32,7 +32,7 @@ class Riemann::Babbler::Uplay < Riemann::Babbler
32
32
 
33
33
 
34
34
  def collect
35
- now = Time.now.to_i
35
+ now = unixnow
36
36
  array = Array.new
37
37
  status = JSON.parse File.read(plugin.file)
38
38
 
@@ -74,5 +74,10 @@ module Riemann
74
74
  end
75
75
  end
76
76
 
77
+ # unix timestamp
78
+ def unixnow
79
+ Time.now.to_i
80
+ end
81
+
77
82
  end
78
83
  end
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '1.0.5.7'
3
+ VERSION = '1.0.6'
4
4
  end
5
5
  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.0.5.7
4
+ version: 1.0.6
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-06-14 00:00:00.000000000 Z
12
+ date: 2013-06-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: riemann-client
@@ -167,6 +167,7 @@ files:
167
167
  - lib/riemann/babbler/plugins/dummy.rb
168
168
  - lib/riemann/babbler/plugins/exim4.rb
169
169
  - lib/riemann/babbler/plugins/http.rb
170
+ - lib/riemann/babbler/plugins/je.rb
170
171
  - lib/riemann/babbler/plugins/la.rb
171
172
  - lib/riemann/babbler/plugins/mdadm.rb
172
173
  - lib/riemann/babbler/plugins/megacli.rb
@@ -177,6 +178,7 @@ files:
177
178
  - lib/riemann/babbler/plugins/nvidia.rb
178
179
  - lib/riemann/babbler/plugins/panels.rb
179
180
  - lib/riemann/babbler/plugins/runit.rb
181
+ - lib/riemann/babbler/plugins/sdigrabber.rb
180
182
  - lib/riemann/babbler/plugins/selfupdate.rb
181
183
  - lib/riemann/babbler/plugins/uplay.rb
182
184
  - lib/riemann/babbler/support/deep_merge.rb