riemann-babbler 1.0.3 → 1.0.4
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,24 @@ | |
| 1 | 
            +
            require 'json'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            class Riemann::Babbler::Cloudrestreamerstatus < Riemann::Babbler
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              def init
         | 
| 6 | 
            +
                plugin.set_default(:service, 'cloud restreamer clients')
         | 
| 7 | 
            +
                plugin.set_default(:interval, 60)
         | 
| 8 | 
            +
                plugin.set_default(:url, 'http://localhost/client/all')
         | 
| 9 | 
            +
              end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              def collect
         | 
| 12 | 
            +
                clients = 0
         | 
| 13 | 
            +
                json = JSON.parse rest_get(plugin.url)
         | 
| 14 | 
            +
                json.each do |worker|
         | 
| 15 | 
            +
                  next unless worker.has_key? "processors"
         | 
| 16 | 
            +
                  worker["processors"].each do |key, client_hash|
         | 
| 17 | 
            +
                    next unless client_hash.has_key? "clients"
         | 
| 18 | 
            +
                    client_hash["clients"].each {|key| clients += 1}
         | 
| 19 | 
            +
                  end
         | 
| 20 | 
            +
                end
         | 
| 21 | 
            +
                {:service => plugin.service, :description => "Cloud restreamer clients in #{plugin.url}", :metric => clients, :state => 'ok' }
         | 
| 22 | 
            +
              end
         | 
| 23 | 
            +
             | 
| 24 | 
            +
            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: 1.0. | 
| 4 | 
            +
              version: 1.0.4
         | 
| 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- | 
| 12 | 
            +
            date: 2013-06-05 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: riemann-client
         | 
| @@ -158,6 +158,7 @@ files: | |
| 158 158 | 
             
            - config.yml
         | 
| 159 159 | 
             
            - lib/riemann/babbler/plugin.rb
         | 
| 160 160 | 
             
            - lib/riemann/babbler/plugins/cloudclients.rb
         | 
| 161 | 
            +
            - lib/riemann/babbler/plugins/cloudrestreamerstatus.rb
         | 
| 161 162 | 
             
            - lib/riemann/babbler/plugins/cpu.rb
         | 
| 162 163 | 
             
            - lib/riemann/babbler/plugins/cpufan.rb
         | 
| 163 164 | 
             
            - lib/riemann/babbler/plugins/cputemp.rb
         |