sensu-plugins-puppet 1.1.0 → 1.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a9626453a59705edc4715523c12c366b2fcd7a9
4
- data.tar.gz: c882bfd19f801e501224844daf67504966a08dc2
3
+ metadata.gz: 1b9a2e165b330e9a41397469f45e8e021e33b309
4
+ data.tar.gz: 54853b54ec8e00454b56e6b61a89349fbb0d735f
5
5
  SHA512:
6
- metadata.gz: 2c2b7f1bd8ad0e332836f4364a6b0f9b4fd1a6016b7ccc821db4e85d8b368fdd5d14aae5b67b3cd9cac4d240c46f0ce0c74717805d488b566093353e4d3f4be4
7
- data.tar.gz: 754eaa453b7811cf59347bf0f452c1adae0b9091c5e3501eaa811e63d9b906f4531664c6b3459b37eef4aabd81bce6921b7f9686a1e89d37748f88489b097379
6
+ metadata.gz: e2cb9889c112bb06f47e45c4d139ece3d28add0412a103b7beb3de85254550edd647eeba76ce224a4cb89895c3414c3d3c1e9db207ed5a8f4440f6388377a8a5
7
+ data.tar.gz: 597bcbcec10b60a1d291c52f050477cf8581bdb34ed2370f95c5c13196f513f05722a0cc4c9d99da8bf85e93e5792281cb98d979417874e1854a5b4d1b4eb39d
data/CHANGELOG.md CHANGED
@@ -4,6 +4,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+ ## [1.2.0] - 2017-05-30
8
+ ### Added
9
+ - `check-puppet-last-run.rb`: Added option for reporting failed restarts (@antonidabek)
7
10
 
8
11
  ## [1.1.0] - 2017-01-30
9
12
  ### Added
@@ -31,7 +34,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
31
34
  ### Added
32
35
  - initial release
33
36
 
34
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-puppet/compare/1.1.0...HEAD
37
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-puppet/compare/1.2.0...HEAD
38
+ [1.2.0]: https://github.com/sensu-plugins/sensu-plugins-puppet/compare/1.1.0...1.2.0
35
39
  [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-puppet/compare/1.0.0...1.1.0
36
40
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-puppet/compare/0.0.2...1.0.0
37
41
  [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-puppet/compare/0.0.1...0.0.2
@@ -59,6 +59,13 @@ class PuppetLastRun < Sensu::Plugin::Check::CLI
59
59
  default: '/opt/puppetlabs/puppet/cache/state/agent_disabled.lock',
60
60
  description: 'Path to agent disabled lock file'
61
61
 
62
+ option :report_restart_failures,
63
+ short: '-r',
64
+ long: '--report-restart-failures',
65
+ boolean: true,
66
+ default: false,
67
+ description: 'Raise alerts if restart failures have happened'
68
+
62
69
  def run
63
70
  unless File.exist?(config[:summary_file])
64
71
  unknown "File #{config[:summary_file]} not found"
@@ -78,6 +85,11 @@ class PuppetLastRun < Sensu::Plugin::Check::CLI
78
85
  else
79
86
  critical "#{config[:summary_file]} is missing information about the events"
80
87
  end
88
+ @restart_failures = if config[:report_restart_failures] && summary['resources']
89
+ summary['resources']['failed_to_restart'].to_i
90
+ else
91
+ 0
92
+ end
81
93
  rescue
82
94
  unknown "Could not process #{config[:summary_file]}"
83
95
  end
@@ -95,7 +107,11 @@ class PuppetLastRun < Sensu::Plugin::Check::CLI
95
107
  @message += " with #{@failures} failures"
96
108
  end
97
109
 
98
- if @now - @last_run > config[:crit_age] || @failures > 0
110
+ if @restart_failures > 0
111
+ @message += " with #{@restart_failures} restart failures"
112
+ end
113
+
114
+ if @now - @last_run > config[:crit_age] || @failures > 0 || @restart_failures > 0
99
115
  critical @message
100
116
  elsif @now - @last_run > config[:warn_age]
101
117
  warning @message
@@ -3,7 +3,7 @@ module SensuPluginsPuppet
3
3
  # This defines the version of the gem
4
4
  module Version
5
5
  MAJOR = 1
6
- MINOR = 1
6
+ MINOR = 2
7
7
  PATCH = 0
8
8
 
9
9
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.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: 2017-01-31 00:00:00.000000000 Z
11
+ date: 2017-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin