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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: de30c8430383b46c428eaa14cdc185d1d36376b0
4
- data.tar.gz: 584f069f0e45a2e4efc55cafd8622ec2b8d0ec4a
3
+ metadata.gz: 6d2452ce378af68d8bc23a49116f07d678d41598
4
+ data.tar.gz: 6f400985f63c53da1e8621a22ccc894bdee28a84
5
5
  SHA512:
6
- metadata.gz: 0ad54bebf2b99dd790a534fdf2e136065226daa30769d6a93f4e31dab839ba39210c04b712c43487685b44cc7ed3260537dd758b6cdbf9d963c7cae6c24974d9
7
- data.tar.gz: f5a13438d5b329d282c1ac1c0b7dbf427a5bc621c1d78ad55d12724efb99b3cd041ac12ba7e0bb452b733caf07455dae305a0cfa1c0b39ce9d88419f789852d4
6
+ metadata.gz: 933a44b0a0a30b50287b8aed71169747bfecbf5bc84ae204f528af0f1bdab41316fd9d2bf461adaabdc207fd6838a276a7c6094df41b67e79b3ed90bd9060653
7
+ data.tar.gz: 54a61dcb74918c7da3ea06d5f057967c613282128664a8f6973a77290a0983e5022fccfda22365a9000260599cc45fa7e5fc2d05c4d0ac04b77f270f024a3204
@@ -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/1.2.0...HEAD
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
@@ -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
- uptime_sec = IO.read('/proc/uptime').split[0].to_i
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]
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsUptimeChecks
2
2
  module Version
3
- MAJOR = 1
4
- MINOR = 2
3
+ MAJOR = 2
4
+ MINOR = 0
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
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: 1.2.0
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-09-17 00:00:00.000000000 Z
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.0.0
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.13
197
+ rubygems_version: 2.6.14
198
198
  signing_key:
199
199
  specification_version: 4
200
200
  summary: Sensu plugins for uptime-checks