sensu-plugins-stale-results 0.0.1 → 0.0.2

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: a8a39c2cb442994fb202eabfb166b091bddb2647
4
- data.tar.gz: e166f302c89193ef6aba9b6a681d04afb9ecbcb5
3
+ metadata.gz: 1a47be745fb1d44f1359d9367cc740ef0ff0bd89
4
+ data.tar.gz: 1c67176577c8a6271acd70cb0582cc6ba8f0f48a
5
5
  SHA512:
6
- metadata.gz: d34335670082a4b28182deaccfb04d2d95125d4914bce2401a8f1fadd46731e138deb7a0a650f5a96c9ee846d376cb9bb80a2f1a2f1e3de09f56619bdd028bc5
7
- data.tar.gz: 2fe77c146b125530c5af4dd081b8739af65963731105aa2d29a096ca93c840b52bc62015425b85de2b9f400fa8da7972d70d0972bc25e8ea0ebcab8237287659
6
+ metadata.gz: f844a0e4fdeeee34df14e02f139fe8355b3bc0afd2818375ba8259390855d048ed2f17fc60425e76c11d9d5e5f884998300a56eeb965b24fe759c6664b4bb1ad
7
+ data.tar.gz: 2b3b27ce73fec72767c8424600a66279fb63189b8968a15f41402ca918c5854f04f00fef1535efccab4341a638097e018fdb3c1afe67f4d6a588e11ae989b64c
@@ -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.2] - 2016-01-14
9
+ ### Added
10
+ - Parsing stale time using chronic_duration
11
+
8
12
  ## [0.0.1] - 2016-01-13
9
13
  ### Added
10
14
  - Initial release
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Sensu plugin for monitoring Sensu stale check results
2
2
 
3
3
  A sensu plugin to monitor sensu stale check results. You can then implement an handler that purges
4
- the results after X occurences.
4
+ the results after X days using the [sensu-handlers-purge-stale-results](http://github.com/m4ce/sensu-handlers-purge-stale-results) handler.
5
5
 
6
6
  ## Usage
7
7
 
@@ -10,10 +10,12 @@ The plugin accepts the following command line options:
10
10
  ```
11
11
  Usage: check-stale-results.rb (options)
12
12
  -c, --crit <COUNT> Critical if number of stale check results exceeds COUNT
13
- -s, --stale <SECONDS> Number of seconds to consider a check result stale (default: 86400)
13
+ -s, --stale <TIME> Elapsed time to consider a check result result (default: 1d)
14
14
  -v, --verbose Be verbose
15
15
  -w, --warn <COUNT> Warn if number of stale check results exceeds COUNT (default: 1)
16
16
  ```
17
17
 
18
+ the --stale command line option accepts elapsed times formatted as documented in https://github.com/hpoydar/chronic_duration.
19
+
18
20
  ## Author
19
21
  Matteo Cerutti - <matteo.cerutti@hotmail.co.uk>
@@ -9,16 +9,17 @@ require 'net/http'
9
9
  require 'json'
10
10
  require 'sensu-plugin/utils'
11
11
  require 'sensu-plugin/check/cli'
12
+ require 'chronic_duration'
12
13
 
13
14
  class CheckStaleResults < Sensu::Plugin::Check::CLI
14
15
  include Sensu::Plugin::Utils
15
16
 
16
17
  option :stale,
17
- :description => "Number of seconds to consider a check result stale (default: 86400)",
18
- :short => "-s <SECONDS>",
19
- :long => "--stale <SECONDS>",
20
- :proc => proc(&:to_i),
21
- :default => 86400
18
+ :description => "Elapsed time to consider a check result result (default: 1d)",
19
+ :short => "-s <TIME>",
20
+ :long => "--stale <TIME>",
21
+ :proc => proc { |s| ChronicDuration.parse(s) },
22
+ :default => ChronicDuration.parse('1d')
22
23
 
23
24
  option :verbose,
24
25
  :description => "Be verbose",
@@ -2,7 +2,7 @@ module SensuPluginsStaleResults
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-stale-results
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
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-13 00:00:00.000000000 Z
11
+ date: 2016-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
26
  version: 1.2.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: chronic_duration
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.10.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.10.6
27
41
  description: This plugin provides facilities for monitoring stale sensu check results
28
42
  email: "<matteo.cerutti@hotmail.co.uk>"
29
43
  executables: