sensu-plugins-ntp 0.0.4 → 1.0.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 +4 -4
- data/CHANGELOG.md +17 -3
- data/README.md +0 -1
- data/bin/check-ntp.rb +21 -1
- data/lib/sensu-plugins-ntp/version.rb +2 -2
- metadata +41 -62
- checksums.yaml.gz.sig +0 -5
- data.tar.gz.sig +0 -0
- 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: 1719742cd55759cf40370fad39fc2a28533a6e47
|
4
|
+
data.tar.gz: 33d75e09c5732fe500fc9fc98ffd522785eff3b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72058e4cfd6e3443838d8d7418f8bf906ef8fbd6e92af5cf18c3c80c43355116d259635fcdd788c53eddff9ad9d28e10755779cb06a9fbf054846033124da088
|
7
|
+
data.tar.gz: d829f9d1da934c6d7940ddbd4371e5453e8278ff86fe7958753d2add66a6f7eb7afe2b6f701e1e193d3dd251c56a55b75025e31d53e6d987260a4a41404d358b
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
3
3
|
|
4
4
|
This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
|
5
5
|
|
6
|
-
## Unreleased]
|
6
|
+
## [Unreleased]
|
7
|
+
|
8
|
+
## [1.0.0] - 2016-07-13
|
9
|
+
### Added
|
10
|
+
- Added check for unsynced NTP state with configurable severity, returns unknown by default.
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- Loosen dependency on sensu-plugin from = 1.2.0 to ~> 1.2
|
14
|
+
- Updated Rubocop to ~> 0.40, applied auto-correct.
|
15
|
+
|
16
|
+
### Removed
|
17
|
+
- Remove Ruby 1.9.3 support; add Ruby 2.3.0 support to test matrix
|
7
18
|
|
8
19
|
## [0.0.4] - 2015-10-24
|
9
20
|
### Fixed
|
@@ -17,7 +28,6 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
17
28
|
- Modified check-ntp.rb to ignore additional initial line of ntpq output on some systems (e.g. Centos6)
|
18
29
|
|
19
30
|
## [0.0.2] - 2015-06-03
|
20
|
-
|
21
31
|
### Fixed
|
22
32
|
- added binstubs
|
23
33
|
|
@@ -25,7 +35,11 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
25
35
|
- removed cruft from /lib
|
26
36
|
|
27
37
|
## 0.0.1 - 2015-05-20
|
28
|
-
|
29
38
|
### Added
|
30
39
|
- initial release
|
31
40
|
|
41
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-ntp/compare/1.0.0...HEAD
|
42
|
+
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-ntp/compare/0.0.4...1.0.0
|
43
|
+
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-ntp/compare/0.0.3...0.0.4
|
44
|
+
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-ntp/compare/0.0.2...0.0.3
|
45
|
+
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-ntp/compare/0.0.1...0.0.2
|
data/README.md
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ntp)
|
6
6
|
[](https://codeclimate.com/github/sensu-plugins/sensu-plugins-ntp)
|
7
7
|
[](https://gemnasium.com/sensu-plugins/sensu-plugins-ntp)
|
8
|
-
[ ](https://codeship.com/projects/79858)
|
9
8
|
|
10
9
|
## Functionality
|
11
10
|
|
data/bin/check-ntp.rb
CHANGED
@@ -29,6 +29,8 @@
|
|
29
29
|
# 16: Unsynchronized
|
30
30
|
# 17-255: Reserved
|
31
31
|
#
|
32
|
+
# Source Field Status Codes
|
33
|
+
# http://doc.ntp.org/current-stable/decode.html
|
32
34
|
|
33
35
|
require 'sensu-plugin/check/cli'
|
34
36
|
|
@@ -49,15 +51,33 @@ class CheckNTP < Sensu::Plugin::Check::CLI
|
|
49
51
|
proc: proc(&:to_i),
|
50
52
|
default: 15
|
51
53
|
|
54
|
+
option :unsynced_status,
|
55
|
+
short: '-u CODE',
|
56
|
+
description: 'If ntp_status is unsynced (that is, not yet connected to or disconnected from ntp), what should the response be.',
|
57
|
+
proc: proc(&:downcase),
|
58
|
+
default: 'unknown'
|
59
|
+
|
52
60
|
def run
|
53
61
|
begin
|
54
|
-
output = `ntpq -c "rv 0 stratum,offset"`.split("\n").find { |line|
|
62
|
+
output = `ntpq -c "rv 0 stratum,offset"`.split("\n").find { |line| line.start_with?('stratum') }
|
55
63
|
stratum = output.split(',')[0].split('=')[1].strip.to_i
|
56
64
|
offset = output.split(',')[1].split('=')[1].strip.to_f
|
65
|
+
source_field_status = config[:unsynced_status] == 'ok' ? 6 : /status=[0-3]([0-9])[0-9a-f]{2}/.match(`ntpq -c "rv 0"`)[1].to_i
|
57
66
|
rescue
|
58
67
|
unknown 'NTP command Failed'
|
59
68
|
end
|
60
69
|
|
70
|
+
if source_field_status == 0
|
71
|
+
case config[:unsynced_status]
|
72
|
+
when 'warn'
|
73
|
+
warning 'NTP state unsynced'
|
74
|
+
when 'crit'
|
75
|
+
critical 'NTP state unsynced'
|
76
|
+
when 'unknown'
|
77
|
+
unknown 'NTP state unsynced'
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
61
81
|
if stratum > 15
|
62
82
|
critical 'NTP not synced'
|
63
83
|
elsif stratum > config[:stratum]
|
metadata
CHANGED
@@ -1,186 +1,164 @@
|
|
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: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRIwEAYDVQQDDAltYXR0
|
14
|
-
am9uZXMxGDAWBgoJkiaJk/IsZAEZFgh5aWVsZGJvdDETMBEGCgmSJomT8ixkARkW
|
15
|
-
A2NvbTAeFw0xNTAxMjgyMTAyNTFaFw0xNjAxMjgyMTAyNTFaMEMxEjAQBgNVBAMM
|
16
|
-
CW1hdHRqb25lczEYMBYGCgmSJomT8ixkARkWCHlpZWxkYm90MRMwEQYKCZImiZPy
|
17
|
-
LGQBGRYDY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyTSzVYnO
|
18
|
-
CLgyrIyT1mBQakArQyW8xhi6MlDqyzXHJGeERT790U6EgoBVeS4XoK0ptFZNR8Tf
|
19
|
-
zko0w+Nv47TarSCgkPOaxY+mxWnAVR10dOmfeLr7huiMyps+YD56/EF2FqQ3jf/+
|
20
|
-
qohENfKD91qy1ieEy+Fn7Pf74ltbNKUdkb9a9eFXQ0DQ4ip5vik7DzjQkUTj4lca
|
21
|
-
k6ArwnmHX4YDhZoYtrQJ8jVktN0/+NtA40M5qkCYHNe5tUW25b/tKVYuioxG6b2Z
|
22
|
-
oIzaZxRLxf6HVAWpCVRT/F5+/yjigkX4u++eYacfLGleXQzoK7BL65vHGMJygWEE
|
23
|
-
0TKGqFOrl/L0AQIDAQABo38wfTAJBgNVHRMEAjAAMAsGA1UdDwQEAwIEsDAdBgNV
|
24
|
-
HQ4EFgQUEf6a8Td7MrSZc8ImbLFZAENPbz0wIQYDVR0RBBowGIEWbWF0dGpvbmVz
|
25
|
-
QHlpZWxkYm90LmNvbTAhBgNVHRIEGjAYgRZtYXR0am9uZXNAeWllbGRib3QuY29t
|
26
|
-
MA0GCSqGSIb3DQEBBQUAA4IBAQBbzXAYA3BVGw8DZ0YYoY1VHPNEcH5qPIApmHO8
|
27
|
-
rvSmuUT0yMEi7u00H/5uHRFf4LleGT/+sTdyXKsNPGT9kdRuQEgwi+vf7Zfvd8aX
|
28
|
-
UF/+4VkEYf/8rV8Ere6u2QaWPgApdMV6JjKr1fAwCTd8AuGXNaWItiPPMseSQzLJ
|
29
|
-
JKP4hVvbc1d+oS925B1lcBiqn2aYvElbyNAVmQPywNNqkWmvtlqj9ZVJfV5HQLdu
|
30
|
-
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
|
-
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
|
-
-----END CERTIFICATE-----
|
33
|
-
date: 2015-10-24 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-07-14 00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
14
|
name: sensu-plugin
|
37
15
|
requirement: !ruby/object:Gem::Requirement
|
38
16
|
requirements:
|
39
|
-
- -
|
17
|
+
- - "~>"
|
40
18
|
- !ruby/object:Gem::Version
|
41
|
-
version: 1.2
|
19
|
+
version: '1.2'
|
42
20
|
type: :runtime
|
43
21
|
prerelease: false
|
44
22
|
version_requirements: !ruby/object:Gem::Requirement
|
45
23
|
requirements:
|
46
|
-
- -
|
24
|
+
- - "~>"
|
47
25
|
- !ruby/object:Gem::Version
|
48
|
-
version: 1.2
|
26
|
+
version: '1.2'
|
49
27
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
28
|
+
name: bundler
|
51
29
|
requirement: !ruby/object:Gem::Requirement
|
52
30
|
requirements:
|
53
31
|
- - "~>"
|
54
32
|
- !ruby/object:Gem::Version
|
55
|
-
version: '
|
33
|
+
version: '1.7'
|
56
34
|
type: :development
|
57
35
|
prerelease: false
|
58
36
|
version_requirements: !ruby/object:Gem::Requirement
|
59
37
|
requirements:
|
60
38
|
- - "~>"
|
61
39
|
- !ruby/object:Gem::Version
|
62
|
-
version: '
|
40
|
+
version: '1.7'
|
63
41
|
- !ruby/object:Gem::Dependency
|
64
|
-
name:
|
42
|
+
name: codeclimate-test-reporter
|
65
43
|
requirement: !ruby/object:Gem::Requirement
|
66
44
|
requirements:
|
67
|
-
- -
|
45
|
+
- - "~>"
|
68
46
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.
|
47
|
+
version: '0.4'
|
70
48
|
type: :development
|
71
49
|
prerelease: false
|
72
50
|
version_requirements: !ruby/object:Gem::Requirement
|
73
51
|
requirements:
|
74
|
-
- -
|
52
|
+
- - "~>"
|
75
53
|
- !ruby/object:Gem::Version
|
76
|
-
version: 0.
|
54
|
+
version: '0.4'
|
77
55
|
- !ruby/object:Gem::Dependency
|
78
|
-
name:
|
56
|
+
name: github-markup
|
79
57
|
requirement: !ruby/object:Gem::Requirement
|
80
58
|
requirements:
|
81
59
|
- - "~>"
|
82
60
|
- !ruby/object:Gem::Version
|
83
|
-
version: '3
|
61
|
+
version: '1.3'
|
84
62
|
type: :development
|
85
63
|
prerelease: false
|
86
64
|
version_requirements: !ruby/object:Gem::Requirement
|
87
65
|
requirements:
|
88
66
|
- - "~>"
|
89
67
|
- !ruby/object:Gem::Version
|
90
|
-
version: '3
|
68
|
+
version: '1.3'
|
91
69
|
- !ruby/object:Gem::Dependency
|
92
|
-
name:
|
70
|
+
name: pry
|
93
71
|
requirement: !ruby/object:Gem::Requirement
|
94
72
|
requirements:
|
95
73
|
- - "~>"
|
96
74
|
- !ruby/object:Gem::Version
|
97
|
-
version: '
|
75
|
+
version: '0.10'
|
98
76
|
type: :development
|
99
77
|
prerelease: false
|
100
78
|
version_requirements: !ruby/object:Gem::Requirement
|
101
79
|
requirements:
|
102
80
|
- - "~>"
|
103
81
|
- !ruby/object:Gem::Version
|
104
|
-
version: '
|
82
|
+
version: '0.10'
|
105
83
|
- !ruby/object:Gem::Dependency
|
106
84
|
name: rake
|
107
85
|
requirement: !ruby/object:Gem::Requirement
|
108
86
|
requirements:
|
109
87
|
- - "~>"
|
110
88
|
- !ruby/object:Gem::Version
|
111
|
-
version: '10.
|
89
|
+
version: '10.5'
|
112
90
|
type: :development
|
113
91
|
prerelease: false
|
114
92
|
version_requirements: !ruby/object:Gem::Requirement
|
115
93
|
requirements:
|
116
94
|
- - "~>"
|
117
95
|
- !ruby/object:Gem::Version
|
118
|
-
version: '10.
|
96
|
+
version: '10.5'
|
119
97
|
- !ruby/object:Gem::Dependency
|
120
|
-
name:
|
98
|
+
name: redcarpet
|
121
99
|
requirement: !ruby/object:Gem::Requirement
|
122
100
|
requirements:
|
123
101
|
- - "~>"
|
124
102
|
- !ruby/object:Gem::Version
|
125
|
-
version: '
|
103
|
+
version: '3.2'
|
126
104
|
type: :development
|
127
105
|
prerelease: false
|
128
106
|
version_requirements: !ruby/object:Gem::Requirement
|
129
107
|
requirements:
|
130
108
|
- - "~>"
|
131
109
|
- !ruby/object:Gem::Version
|
132
|
-
version: '
|
110
|
+
version: '3.2'
|
133
111
|
- !ruby/object:Gem::Dependency
|
134
|
-
name:
|
112
|
+
name: rubocop
|
135
113
|
requirement: !ruby/object:Gem::Requirement
|
136
114
|
requirements:
|
137
115
|
- - "~>"
|
138
116
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
117
|
+
version: 0.40.0
|
140
118
|
type: :development
|
141
119
|
prerelease: false
|
142
120
|
version_requirements: !ruby/object:Gem::Requirement
|
143
121
|
requirements:
|
144
122
|
- - "~>"
|
145
123
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
124
|
+
version: 0.40.0
|
147
125
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
126
|
+
name: rspec
|
149
127
|
requirement: !ruby/object:Gem::Requirement
|
150
128
|
requirements:
|
151
129
|
- - "~>"
|
152
130
|
- !ruby/object:Gem::Version
|
153
|
-
version: '
|
131
|
+
version: '3.4'
|
154
132
|
type: :development
|
155
133
|
prerelease: false
|
156
134
|
version_requirements: !ruby/object:Gem::Requirement
|
157
135
|
requirements:
|
158
136
|
- - "~>"
|
159
137
|
- !ruby/object:Gem::Version
|
160
|
-
version: '
|
138
|
+
version: '3.4'
|
161
139
|
- !ruby/object:Gem::Dependency
|
162
|
-
name:
|
140
|
+
name: yard
|
163
141
|
requirement: !ruby/object:Gem::Requirement
|
164
142
|
requirements:
|
165
143
|
- - "~>"
|
166
144
|
- !ruby/object:Gem::Version
|
167
|
-
version: '0.
|
145
|
+
version: '0.8'
|
168
146
|
type: :development
|
169
147
|
prerelease: false
|
170
148
|
version_requirements: !ruby/object:Gem::Requirement
|
171
149
|
requirements:
|
172
150
|
- - "~>"
|
173
151
|
- !ruby/object:Gem::Version
|
174
|
-
version: '0.
|
152
|
+
version: '0.8'
|
175
153
|
description: |-
|
176
154
|
This plugin provides native NTP instrumentation
|
177
155
|
for monitoring and metrics collection, including:
|
178
|
-
server drift, and metrics via `ntpdate` and `ntpstats
|
156
|
+
server drift, and metrics via `ntpdate` and `ntpstats`.
|
179
157
|
email: "<sensu-users@googlegroups.com>"
|
180
158
|
executables:
|
181
|
-
- metrics-ntpstats.rb
|
182
|
-
- metrics-ntpdate.rb
|
183
159
|
- check-ntp.rb
|
160
|
+
- metrics-ntpdate.rb
|
161
|
+
- metrics-ntpstats.rb
|
184
162
|
extensions: []
|
185
163
|
extra_rdoc_files: []
|
186
164
|
files:
|
@@ -210,7 +188,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
210
188
|
requirements:
|
211
189
|
- - ">="
|
212
190
|
- !ruby/object:Gem::Version
|
213
|
-
version:
|
191
|
+
version: 2.0.0
|
214
192
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
193
|
requirements:
|
216
194
|
- - ">="
|
@@ -218,8 +196,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
196
|
version: '0'
|
219
197
|
requirements: []
|
220
198
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.
|
199
|
+
rubygems_version: 2.5.1
|
222
200
|
signing_key:
|
223
201
|
specification_version: 4
|
224
202
|
summary: Sensu plugins for ntp
|
225
203
|
test_files: []
|
204
|
+
has_rdoc:
|
checksums.yaml.gz.sig
DELETED
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|