sensu-plugins-docker 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fdd8b18ca5f1f21fdb938571b8f4f530a1f8daaa
4
- data.tar.gz: 1dd8364c04b0c3ac9538a0d6f2145608204981bd
3
+ metadata.gz: 645a9f3659b23cffcf10ff781afd499f9c7d3e4a
4
+ data.tar.gz: d767b667130c58182b49a838694ea20d5a6d59ae
5
5
  SHA512:
6
- metadata.gz: 6d94f617e811e3cb122e047dccb7eba2b3769f4197827db89bb05424c098d0b0f137c8b9879a2673dca48bf53cba6287556b4211267a55f724355738247b4091
7
- data.tar.gz: 4ef39a0eb65a4420e08de03a5cf7345c1b39ba4c4b636b52c348705ab05d762a93466ef3ed78b2f430843d8b8d0433ba19112f580ab5e93e91b8b34cb2d203b7
6
+ metadata.gz: 2fba877081039b53878f84ae9a9788bf035a3545942565d3e644edc99720bde99648627a0f2cb806b800d736868dc2ec03b0e85d60435a85ab2c35350cd0437c
7
+ data.tar.gz: 6badaf7ef560fb6052819500ee71cf9a35ec6d6a79a53e933836641cf6f1d0aa103bcb018af6abe42270d1a1291f67fe9849cdaaf6797aeb896462efc3e6aa4e
data/CHANGELOG.md CHANGED
@@ -5,12 +5,16 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
- ## 1.0.0 - 2016-05-24
8
+ ## [1.1.0] - 2016-06-03
9
+ ### Added
10
+ - check-container-logs.rb: added `-s|--seconds-ago` option to be able to set time interval more precisely
11
+
12
+ ## [1.0.0] - 2016-05-24
9
13
  Note: this release changes how connections are made to the Docker API and also
10
14
  changes some options. Review your check commands before deploying this version.
11
15
 
12
16
  ### Added
13
- - Added check-container-logs.rb to check docker logs for matching strings
17
+ - Added check-container-logs.rb to check docker logs for matching strings
14
18
  - Support for Ruby 2.3.0
15
19
  - metrics-docker-container.rb: add option to override the default path to cgroup.proc
16
20
 
@@ -42,7 +46,8 @@ changes some options. Review your check commands before deploying this version.
42
46
  ### Added
43
47
  - initial release
44
48
 
45
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.0.0...HEAD
49
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.1.0...HEAD
50
+ [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/1.0.0...1.1.0
46
51
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/0.0.4...1.0.0
47
52
  [0.0.4]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/0.0.3...0.0.4
48
53
  [0.0.3]: https://github.com/sensu-plugins/sensu-plugins-docker/compare/0.0.2...0.0.3
@@ -77,8 +77,14 @@ insensitive',
77
77
  long: '--hours-ago HOURS',
78
78
  required: false
79
79
 
80
- def calculate_timestamp(hours)
81
- seconds_ago = hours.to_i * 3600
80
+ option :seconds_ago,
81
+ description: 'Amount of time in seconds to look back for log strings',
82
+ short: '-s SECONDS',
83
+ long: '--seconds-ago SECONDS',
84
+ required: false
85
+
86
+ def calculate_timestamp(seconds_ago = nil)
87
+ seconds_ago = yield if block_given?
82
88
  (Time.now - seconds_ago).to_i
83
89
  end
84
90
 
@@ -86,8 +92,11 @@ insensitive',
86
92
  client = create_docker_client
87
93
  path = "/containers/#{container_name}/logs?stdout=true&stderr=true"
88
94
  if config.key? :hours_ago
89
- path = "#{path}&since=#{calculate_timestamp config[:hours_ago]}"
95
+ timestamp = calculate_timestamp { config[:hours_ago].to_i * 3600 }
96
+ elsif config.key? :seconds_ago
97
+ timestamp = calculate_timestamp config[:seconds_ago].to_i
90
98
  end
99
+ path = "#{path}&since=#{timestamp}"
91
100
  req = Net::HTTP::Get.new path
92
101
 
93
102
  client.request req do |response|
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsDocker
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-docker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-24 00:00:00.000000000 Z
11
+ date: 2016-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docker-api