sensu-plugins-ntp 0.0.3 → 0.0.4

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: 0017a2146ae7d8371a521fb68cf954520f5cf635
4
- data.tar.gz: 485a9ef9904ce945e40f7a73a0fbae0f1cab22c3
3
+ metadata.gz: a9c3ef468bc55fc9cd5479aa85bd19a99778cd98
4
+ data.tar.gz: 7e0308fcaad969e66378236eda09c82dd018b6f6
5
5
  SHA512:
6
- metadata.gz: ac6c62af6d63613140d631390bfa48303457f11ae80070d252f00bebd343774222ee41f425a5ec92b87f3eb644853d0fe441a5c0703beab446809120b8064140
7
- data.tar.gz: 1f8ec49f232964a96260df98b1c34fe92bee35468ddcd4fbc661f185555350bad911899fafb351e5e822b6c80fd6cb83cb95014263f76bc102dcbc3ca264659c
6
+ metadata.gz: 8bd621b3cbc9ea140ed3eafc1583b6d2030bcd705ff751a682cce3552a8a5f42ef601b341fa6d371c367a0e30e2ab884d5a225a9082801ab71f618e1894bfd41
7
+ data.tar.gz: 6ba95c688e42eb53d857f4cab68a43b35e51c2120ff381788c0ceff2f391f20970490215e68a906d8cd3aa552c809c73c789adddfde40955de45fe865f656558
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
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][unreleased]
7
7
 
8
+ ## [0.0.4] - 2015-10-24
9
+ ### Fixed
10
+ - Fixed warning and critical args to use float instead of int. Added arg to have a configurable stratum limit.
11
+
8
12
  ## [0.0.3] - 2015-07-14
9
13
  ### Changed
10
14
  - updated sensu-plugin gem to 1.2.0
data/README.md CHANGED
@@ -18,7 +18,7 @@
18
18
 
19
19
  ## Installation
20
20
 
21
- [Installation and Setup](https://github.com/sensu-plugins/documentation/blob/master/user_docs/installation_instructions.md)
21
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
22
22
 
23
23
 
24
24
  ## Notes
data/bin/check-ntp.rb CHANGED
@@ -23,20 +23,32 @@
23
23
  # Released under the same terms as Sensu (the MIT license); see LICENSE
24
24
  # for details.
25
25
  #
26
+ # Stratum Levels
27
+ # 1: Primary reference (e.g., calibrated atomic clock, radio clock, etc...)
28
+ # 2-15: Secondary reference (via NTP, calculated as the stratum of your system peer plus one)
29
+ # 16: Unsynchronized
30
+ # 17-255: Reserved
31
+ #
26
32
 
27
33
  require 'sensu-plugin/check/cli'
28
34
 
29
35
  class CheckNTP < Sensu::Plugin::Check::CLI
30
36
  option :warn,
31
37
  short: '-w WARN',
32
- proc: proc(&:to_i),
38
+ proc: proc(&:to_f),
33
39
  default: 10
34
40
 
35
41
  option :crit,
36
42
  short: '-c CRIT',
37
- proc: proc(&:to_i),
43
+ proc: proc(&:to_f),
38
44
  default: 100
39
45
 
46
+ option :stratum,
47
+ short: '-s STRATUM',
48
+ description: 'check that stratum meets or exceeds desired value',
49
+ proc: proc(&:to_i),
50
+ default: 15
51
+
40
52
  def run
41
53
  begin
42
54
  output = `ntpq -c "rv 0 stratum,offset"`.split("\n").find { |line| line.start_with?('stratum') }
@@ -46,7 +58,11 @@ class CheckNTP < Sensu::Plugin::Check::CLI
46
58
  unknown 'NTP command Failed'
47
59
  end
48
60
 
49
- critical 'NTP not synced' if stratum > 15
61
+ if stratum > 15
62
+ critical 'NTP not synced'
63
+ elsif stratum > config[:stratum]
64
+ critical "NTP stratum (#{stratum}) above limit (#{config[:stratum]})"
65
+ end
50
66
 
51
67
  message = "NTP offset by #{offset.abs}ms"
52
68
  critical message if offset >= config[:crit] || offset <= -config[:crit]
@@ -43,7 +43,7 @@ class NtpStatsMetrics < Sensu::Plugin::Metric::CLI::Graphite
43
43
 
44
44
  def run
45
45
  # #YELLOW
46
- unless config[:host] == 'localhost' # rubocop:disable IfUnlessModifier
46
+ unless config[:host] == 'localhost'
47
47
  config[:scheme] = config[:host]
48
48
  end
49
49
 
@@ -2,7 +2,7 @@ module SensuPluginsNtp
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 3
5
+ PATCH = 4
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-ntp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
@@ -30,7 +30,7 @@ cert_chain:
30
30
  8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
31
31
  HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
32
32
  -----END CERTIFICATE-----
33
- date: 2015-07-14 00:00:00.000000000 Z
33
+ date: 2015-10-24 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: sensu-plugin
@@ -66,14 +66,14 @@ dependencies:
66
66
  requirements:
67
67
  - - '='
68
68
  - !ruby/object:Gem::Version
69
- version: '0.30'
69
+ version: 0.32.1
70
70
  type: :development
71
71
  prerelease: false
72
72
  version_requirements: !ruby/object:Gem::Requirement
73
73
  requirements:
74
74
  - - '='
75
75
  - !ruby/object:Gem::Version
76
- version: '0.30'
76
+ version: 0.32.1
77
77
  - !ruby/object:Gem::Dependency
78
78
  name: rspec
79
79
  requirement: !ruby/object:Gem::Requirement
@@ -172,7 +172,10 @@ dependencies:
172
172
  - - "~>"
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0.10'
175
- description: Sensu plugins for ntp
175
+ description: |-
176
+ This plugin provides native NTP instrumentation
177
+ for monitoring and metrics collection, including:
178
+ server drift, and metrics via `ntpdate` and `ntpstats`
176
179
  email: "<sensu-users@googlegroups.com>"
177
180
  executables:
178
181
  - metrics-ntpstats.rb
@@ -215,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
218
  version: '0'
216
219
  requirements: []
217
220
  rubyforge_project:
218
- rubygems_version: 2.4.6
221
+ rubygems_version: 2.4.8
219
222
  signing_key:
220
223
  specification_version: 4
221
224
  summary: Sensu plugins for ntp
metadata.gz.sig CHANGED
Binary file