sensu-plugins-rancher-service 0.0.13 → 0.0.14
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/bin/check-rancher-service.rb +25 -21
- data/lib/sensu-plugins-rancher-service/version.rb +1 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 1fab1170bfab2b585c1fe55fb3cc55b732c5940f
         | 
| 4 | 
            +
              data.tar.gz: 1a124895073d38b2172951449637b010c3b1d3d9
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 070b90af5052e2a2dc034e8484fc3751dee224ab25b65cd83ee52acfc03e35958bb80d4ea4494290d2052e885d4f553c6527ec5de6464bdd99c5660742c8afa6
         | 
| 7 | 
            +
              data.tar.gz: 1b6b0d4a23f1380d8c5b586c81432ccc7005778af40cf72971522f69b31d13d3cd632b92f2e886fdd9ad94a6718a0282031c8d30ec57f7bfda39c2c8a10b631d
         | 
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -5,6 +5,10 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang | |
| 5 5 |  | 
| 6 6 | 
             
            ## Unreleased
         | 
| 7 7 |  | 
| 8 | 
            +
            ## [0.0.14] - 2016-01-19
         | 
| 9 | 
            +
            ### Added
         | 
| 10 | 
            +
            - Added support for containers having the io.rancher.container.start_once set to true
         | 
| 11 | 
            +
             | 
| 8 12 | 
             
            ## [0.0.13] - 2016-01-17
         | 
| 9 13 | 
             
            ### Added
         | 
| 10 14 | 
             
            - Fixed service check
         | 
| @@ -143,33 +143,37 @@ class CheckRancherService < Sensu::Plugin::Check::CLI | |
| 143 143 | 
             
                    else
         | 
| 144 144 | 
             
                      container = get_container(container_name)
         | 
| 145 145 |  | 
| 146 | 
            -
                       | 
| 147 | 
            -
             | 
| 148 | 
            -
                        if container['start_count'] > state[container_name]['start_count']
         | 
| 149 | 
            -
                          send_warning(check_name, source, "#{msg} has restarted")
         | 
| 150 | 
            -
                          skip = true
         | 
| 151 | 
            -
                        end
         | 
| 146 | 
            +
                      if container['labels'].has_key?('io.rancher.container.start_once') and container['labels']['io.rancher.container.start_once']
         | 
| 147 | 
            +
                        send_ok(check_name, source, "#{msg} not monitored (start-once)"
         | 
| 152 148 | 
             
                      else
         | 
| 153 | 
            -
                         | 
| 154 | 
            -
             | 
| 149 | 
            +
                        skip = false
         | 
| 150 | 
            +
                        if state.has_key?(container_name)
         | 
| 151 | 
            +
                          if container['start_count'] > state[container_name]['start_count']
         | 
| 152 | 
            +
                            send_warning(check_name, source, "#{msg} has restarted")
         | 
| 153 | 
            +
                            skip = true
         | 
| 154 | 
            +
                          end
         | 
| 155 | 
            +
                        else
         | 
| 156 | 
            +
                          state[container_name] = {}
         | 
| 157 | 
            +
                        end
         | 
| 155 158 |  | 
| 156 | 
            -
             | 
| 157 | 
            -
             | 
| 159 | 
            +
                        # update state
         | 
| 160 | 
            +
                        state[container_name]['start_count'] = container['start_count']
         | 
| 158 161 |  | 
| 159 | 
            -
             | 
| 162 | 
            +
                        next if skip
         | 
| 160 163 |  | 
| 161 | 
            -
             | 
| 162 | 
            -
             | 
| 163 | 
            -
             | 
| 164 | 
            -
             | 
| 164 | 
            +
                        # check if the service restarted
         | 
| 165 | 
            +
                        case container['health_state']
         | 
| 166 | 
            +
                          when 'healthy'
         | 
| 167 | 
            +
                            send_ok(check_name, source, "#{msg} is healthy")
         | 
| 165 168 |  | 
| 166 | 
            -
             | 
| 167 | 
            -
             | 
| 168 | 
            -
             | 
| 169 | 
            +
                          when nil
         | 
| 170 | 
            +
                            send_warning(check_name, source, "#{msg} not monitored")
         | 
| 171 | 
            +
                            unmonitored += 1
         | 
| 169 172 |  | 
| 170 | 
            -
             | 
| 171 | 
            -
             | 
| 172 | 
            -
             | 
| 173 | 
            +
                          else
         | 
| 174 | 
            +
                            send_critical(check_name, source, "#{msg} is not healthy")
         | 
| 175 | 
            +
                            unhealthy += 1
         | 
| 176 | 
            +
                        end
         | 
| 173 177 | 
             
                      end
         | 
| 174 178 | 
             
                    end
         | 
| 175 179 | 
             
                  end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: sensu-plugins-rancher-service
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.0. | 
| 4 | 
            +
              version: 0.0.14
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Matteo Cerutti
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2016-01- | 
| 11 | 
            +
            date: 2016-01-19 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: sensu-plugin
         |