riemann-babbler 1.0.6 → 1.0.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.
@@ -0,0 +1,25 @@
1
+ require 'json'
2
+
3
+ class Riemann::Babbler::Mpeg2lander < Riemann::Babbler
4
+
5
+ def init
6
+ plugin.set_default(:service, 'mpeg2lander')
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 ) )['streams'].each do |stream|
15
+ stream['programs'].each do |programm|
16
+ next unless programm['time_tracker']
17
+ next unless programm['time_tracker']['current_time']
18
+ timing = programm['time_tracker']['current_time'].split('diff')[1].to_i
19
+ array << { :service => plugin.service + " status #{programm['name']}", :metric => timing.to_i, :description => "Mpeg2lander timming name #{programm['name']}" }
20
+ end # end programm
21
+ end # end stream
22
+ array
23
+ end
24
+
25
+ end
@@ -1,5 +1,5 @@
1
1
  module Riemann
2
2
  class Babbler
3
- VERSION = '1.0.6'
3
+ VERSION = '1.0.7'
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.6
4
+ version: 1.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -172,6 +172,7 @@ files:
172
172
  - lib/riemann/babbler/plugins/mdadm.rb
173
173
  - lib/riemann/babbler/plugins/megacli.rb
174
174
  - lib/riemann/babbler/plugins/memory.rb
175
+ - lib/riemann/babbler/plugins/mpeg2lander.rb
175
176
  - lib/riemann/babbler/plugins/net.rb
176
177
  - lib/riemann/babbler/plugins/netstat.rb
177
178
  - lib/riemann/babbler/plugins/nginx.rb