sensu-plugins-uptime-checks 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -1
- data/bin/check-uptime.rb +10 -1
- data/lib/sensu-plugins-uptime-checks/version.rb +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d2452ce378af68d8bc23a49116f07d678d41598
|
4
|
+
data.tar.gz: 6f400985f63c53da1e8621a22ccc894bdee28a84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 933a44b0a0a30b50287b8aed71169747bfecbf5bc84ae204f528af0f1bdab41316fd9d2bf461adaabdc207fd6838a276a7c6094df41b67e79b3ed90bd9060653
|
7
|
+
data.tar.gz: 54a61dcb74918c7da3ea06d5f057967c613282128664a8f6973a77290a0983e5022fccfda22365a9000260599cc45fa7e5fc2d05c4d0ac04b77f270f024a3204
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,14 @@ This Changelog following the conventions laid out [here](https://github.com/sens
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [2.0.0] - 2017-10-18
|
9
|
+
### Breaking Changes
|
10
|
+
- removed ruby 2.0 support && testing (@majormoses)
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- check-uptime.rb: added osx support (@jjdiazgarcia)
|
14
|
+
- check-uptime.rb: minor enhancements for performance and emit an `unknown` for unsupported os rather than a message and it failing with an undefined variable (@majormoses)
|
15
|
+
|
8
16
|
## [1.2.0] - 2017-09-17
|
9
17
|
### Changed
|
10
18
|
- updated PR template and CHANGELOG to point to new CHANGELOG guidelines (@majormoses)
|
@@ -44,7 +52,8 @@ This Changelog following the conventions laid out [here](https://github.com/sens
|
|
44
52
|
### Added
|
45
53
|
- initial release
|
46
54
|
|
47
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/
|
55
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/2.0.0...HEAD
|
56
|
+
[2.0.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.2.0...2.0.0
|
48
57
|
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.1.0...1.2.0
|
49
58
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.0.0...1.1.0
|
50
59
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/0.0.4...1.0.0
|
data/bin/check-uptime.rb
CHANGED
@@ -20,6 +20,7 @@
|
|
20
20
|
# NOTES:
|
21
21
|
# Checks the systems uptime and warns if the system has been rebooted.
|
22
22
|
# 2017 Juan Moreno Martinez - Add reverse option
|
23
|
+
# 2017 Jeronimo Jose Diaz Garcia - Compatibility OS X
|
23
24
|
#
|
24
25
|
# LICENSE:
|
25
26
|
# Copyright 2012 Kees Remmelzwaal <kees@fastmail.com>
|
@@ -44,7 +45,15 @@ class CheckUptime < Sensu::Plugin::Check::CLI
|
|
44
45
|
default: false
|
45
46
|
|
46
47
|
def run
|
47
|
-
|
48
|
+
os = `uname`.chomp
|
49
|
+
if os == 'Darwin'
|
50
|
+
uptime_timestamp = `sysctl kern.boottime | cut -d= -f2 | cut -d" " -f2 | cut -d, -f1`.to_i
|
51
|
+
uptime_sec = `date +%s`.to_i - uptime_timestamp
|
52
|
+
elsif os == 'Linux'
|
53
|
+
uptime_sec = IO.read('/proc/uptime').split[0].to_i
|
54
|
+
else
|
55
|
+
unknown "platform: #{os} is not supported, please open an issue with the output of '`uname`'."
|
56
|
+
end
|
48
57
|
uptime_date = Time.now - uptime_sec
|
49
58
|
|
50
59
|
if config[:greater] && uptime_sec > config[:warn]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-uptime-checks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.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-
|
11
|
+
date: 2017-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -186,7 +186,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
186
186
|
requirements:
|
187
187
|
- - ">="
|
188
188
|
- !ruby/object:Gem::Version
|
189
|
-
version: 2.
|
189
|
+
version: 2.1.0
|
190
190
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - ">="
|
@@ -194,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: '0'
|
195
195
|
requirements: []
|
196
196
|
rubyforge_project:
|
197
|
-
rubygems_version: 2.6.
|
197
|
+
rubygems_version: 2.6.14
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Sensu plugins for uptime-checks
|