riemann-babbler 0.9.9.6 → 0.9.9.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/plugins/panels.rb +27 -0
- data/lib/riemann/version.rb +1 -1
- metadata +4 -6
| @@ -0,0 +1,27 @@ | |
| 1 | 
            +
            require 'json'
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            class Riemann::Babbler::Panels < Riemann::Babbler
         | 
| 4 | 
            +
             | 
| 5 | 
            +
              def init
         | 
| 6 | 
            +
                plugin.set_default(:service, 'panels')
         | 
| 7 | 
            +
                plugin.set_default(:interval, 60)
         | 
| 8 | 
            +
                plugin.set_default(:url, 'http://localhost/panel.json')
         | 
| 9 | 
            +
                plugin.states.set_default(:critical, 60)
         | 
| 10 | 
            +
              end
         | 
| 11 | 
            +
             | 
| 12 | 
            +
              def collect
         | 
| 13 | 
            +
             | 
| 14 | 
            +
                json = JSON.parse rest_get(plugin.url)
         | 
| 15 | 
            +
                good, bad = 0, 0
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                json["panels"].each do |panel|
         | 
| 18 | 
            +
                  panel["status"] == "offline" ? bad += 1 : good += 1
         | 
| 19 | 
            +
                end
         | 
| 20 | 
            +
             | 
| 21 | 
            +
                [
         | 
| 22 | 
            +
                  {:service => plugin.service + " online", :description => "online panels in #{plugin.url}", :metric => good, :state => 'ok' },
         | 
| 23 | 
            +
                  {:service => plugin.service + " offline", :description => "offline panels in #{plugin.url}", :metric => bad }
         | 
| 24 | 
            +
                ]
         | 
| 25 | 
            +
              end
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            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.9.9. | 
| 4 | 
            +
              version: 0.9.9.7
         | 
| 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-05- | 
| 12 | 
            +
            date: 2013-05-27 00:00:00.000000000 Z
         | 
| 13 13 | 
             
            dependencies:
         | 
| 14 14 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 15 15 | 
             
              name: riemann-client
         | 
| @@ -170,6 +170,7 @@ files: | |
| 170 170 | 
             
            - lib/riemann/babbler/plugins/net.rb
         | 
| 171 171 | 
             
            - lib/riemann/babbler/plugins/netstat.rb
         | 
| 172 172 | 
             
            - lib/riemann/babbler/plugins/nginx.rb
         | 
| 173 | 
            +
            - lib/riemann/babbler/plugins/panels.rb
         | 
| 173 174 | 
             
            - lib/riemann/babbler/plugins/runit.rb
         | 
| 174 175 | 
             
            - lib/riemann/babbler/support/deep_merge.rb
         | 
| 175 176 | 
             
            - lib/riemann/babbler/support/monkey_patches.rb
         | 
| @@ -192,9 +193,6 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 192 193 | 
             
              - - ! '>='
         | 
| 193 194 | 
             
                - !ruby/object:Gem::Version
         | 
| 194 195 | 
             
                  version: '0'
         | 
| 195 | 
            -
                  segments:
         | 
| 196 | 
            -
                  - 0
         | 
| 197 | 
            -
                  hash: -2283720559430613103
         | 
| 198 196 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 199 197 | 
             
              none: false
         | 
| 200 198 | 
             
              requirements:
         | 
| @@ -203,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement | |
| 203 201 | 
             
                  version: '0'
         | 
| 204 202 | 
             
            requirements: []
         | 
| 205 203 | 
             
            rubyforge_project: 
         | 
| 206 | 
            -
            rubygems_version: 1.8. | 
| 204 | 
            +
            rubygems_version: 1.8.23
         | 
| 207 205 | 
             
            signing_key: 
         | 
| 208 206 | 
             
            specification_version: 3
         | 
| 209 207 | 
             
            summary: Riemann health checker.
         |