sensu-plugins-ntp 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/bin/check-ntp.rb +19 -3
- data/bin/metrics-ntpstats.rb +1 -1
- data/lib/sensu-plugins-ntp/version.rb +1 -1
- metadata +9 -6
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9c3ef468bc55fc9cd5479aa85bd19a99778cd98
|
4
|
+
data.tar.gz: 7e0308fcaad969e66378236eda09c82dd018b6f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
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(&:
|
38
|
+
proc: proc(&:to_f),
|
33
39
|
default: 10
|
34
40
|
|
35
41
|
option :crit,
|
36
42
|
short: '-c CRIT',
|
37
|
-
proc: proc(&:
|
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
|
-
|
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]
|
data/bin/metrics-ntpstats.rb
CHANGED
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.
|
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-
|
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:
|
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:
|
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:
|
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.
|
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
|