sensu-plugins-uptime-checks 1.1.0 → 1.2.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 +12 -3
- data/bin/check-uptime.rb +14 -3
- data/lib/sensu-plugins-uptime-checks/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de30c8430383b46c428eaa14cdc185d1d36376b0
|
4
|
+
data.tar.gz: 584f069f0e45a2e4efc55cafd8622ec2b8d0ec4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0ad54bebf2b99dd790a534fdf2e136065226daa30769d6a93f4e31dab839ba39210c04b712c43487685b44cc7ed3260537dd758b6cdbf9d963c7cae6c24974d9
|
7
|
+
data.tar.gz: f5a13438d5b329d282c1ac1c0b7dbf427a5bc621c1d78ad55d12724efb99b3cd041ac12ba7e0bb452b733caf07455dae305a0cfa1c0b39ce9d88419f789852d4
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,18 @@
|
|
1
|
-
#Change Log
|
1
|
+
# Change Log
|
2
2
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
3
3
|
|
4
|
-
This
|
4
|
+
This Changelog following the conventions laid out [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [1.2.0] - 2017-09-17
|
9
|
+
### Changed
|
10
|
+
- updated PR template and CHANGELOG to point to new CHANGELOG guidelines (@majormoses)
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- Ruby 2.4 testing (@Evesy)
|
14
|
+
- check-uptime.rb: added `--greater-than` option to change the comparison operator to determine if threshold is exceeded (@Juan-Moreno)
|
15
|
+
|
8
16
|
## [1.1.0] - 2016-11-13
|
9
17
|
### Added
|
10
18
|
- New check `check-uptime.rb` that checks system uptime and warns if the system has been rebooted (@remmelz)
|
@@ -36,7 +44,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
36
44
|
### Added
|
37
45
|
- initial release
|
38
46
|
|
39
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.
|
47
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.2.0...HEAD
|
48
|
+
[1.2.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.1.0...1.2.0
|
40
49
|
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.0.0...1.1.0
|
41
50
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/0.0.4...1.0.0
|
42
51
|
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/0.0.3...0.0.4
|
data/bin/check-uptime.rb
CHANGED
@@ -19,6 +19,7 @@
|
|
19
19
|
#
|
20
20
|
# NOTES:
|
21
21
|
# Checks the systems uptime and warns if the system has been rebooted.
|
22
|
+
# 2017 Juan Moreno Martinez - Add reverse option
|
22
23
|
#
|
23
24
|
# LICENSE:
|
24
25
|
# Copyright 2012 Kees Remmelzwaal <kees@fastmail.com>
|
@@ -31,16 +32,26 @@ require 'sensu-plugin/check/cli'
|
|
31
32
|
class CheckUptime < Sensu::Plugin::Check::CLI
|
32
33
|
option :warn,
|
33
34
|
short: '-w SEC ',
|
34
|
-
description: 'Warn
|
35
|
+
description: 'Warn threshold in SEC',
|
35
36
|
proc: proc(&:to_i),
|
36
37
|
default: 180
|
37
38
|
|
39
|
+
option :greater,
|
40
|
+
short: '-g',
|
41
|
+
long: '--greater-than',
|
42
|
+
description: 'This compare uptime > threshold. Default behavior uptime < threshold',
|
43
|
+
boolean: true,
|
44
|
+
default: false
|
45
|
+
|
38
46
|
def run
|
39
47
|
uptime_sec = IO.read('/proc/uptime').split[0].to_i
|
40
48
|
uptime_date = Time.now - uptime_sec
|
41
49
|
|
42
|
-
if uptime_sec
|
43
|
-
message "System boot detected (#{uptime_sec} seconds up)"
|
50
|
+
if config[:greater] && uptime_sec > config[:warn]
|
51
|
+
message "System boot detected (#{uptime_sec} seconds up), compared using '>'"
|
52
|
+
warning
|
53
|
+
elsif uptime_sec < config[:warn] && !config[:greater]
|
54
|
+
message "System boot detected (#{uptime_sec} seconds up), compared using '<'"
|
44
55
|
warning
|
45
56
|
end
|
46
57
|
|
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.
|
4
|
+
version: 1.2.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:
|
11
|
+
date: 2017-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -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.
|
197
|
+
rubygems_version: 2.6.13
|
198
198
|
signing_key:
|
199
199
|
specification_version: 4
|
200
200
|
summary: Sensu plugins for uptime-checks
|