sensu-plugins-uptime-checks 1.0.0 → 1.1.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 +6 -1
- data/README.md +2 -0
- data/bin/check-uptime.rb +50 -0
- data/lib/sensu-plugins-uptime-checks/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 702c64d7ec1427518c418239293797d8acb08734
|
4
|
+
data.tar.gz: fe76e8f2c124abeb690585eeb33e75b18463dff2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78846540e8536c32caa30852535f9af90cc1582ff563fc72196cf75bf089ce33225b627c48da3507d2a5c6a1b6d0aab9a986c66112a63313afbbb99326093941
|
7
|
+
data.tar.gz: a0c7651ba6fe0c799e75fff001f171b98abf0e37592f29919bf58b2d3ecba17aff788de820d37f95fd536e822eec5151527eb7ad0e2f39384666ac1ccf335c94
|
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]
|
7
7
|
|
8
|
+
## [1.1.0] - 2016-11-13
|
9
|
+
### Added
|
10
|
+
- New check `check-uptime.rb` that checks system uptime and warns if the system has been rebooted (@remmelz)
|
11
|
+
|
8
12
|
## [1.0.0] - 2016-06-16
|
9
13
|
### Changed
|
10
14
|
- Loosen dependency on sensu-plugin from `= 1.2.0` to `~> 1.2`
|
@@ -32,7 +36,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
32
36
|
### Added
|
33
37
|
- initial release
|
34
38
|
|
35
|
-
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.
|
39
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.1.0...HEAD
|
40
|
+
[1.1.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/1.0.0...1.1.0
|
36
41
|
[1.0.0]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/0.0.4...1.0.0
|
37
42
|
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/0.0.3...0.0.4
|
38
43
|
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-uptime-checks/compare/0.0.2...0.0.3
|
data/README.md
CHANGED
data/bin/check-uptime.rb
ADDED
@@ -0,0 +1,50 @@
|
|
1
|
+
#! /usr/bin/env ruby
|
2
|
+
# encoding: UTF-8
|
3
|
+
#
|
4
|
+
# check-uptime
|
5
|
+
#
|
6
|
+
# DESCRIPTION:
|
7
|
+
#
|
8
|
+
# OUTPUT:
|
9
|
+
# plain text
|
10
|
+
#
|
11
|
+
# PLATFORMS:
|
12
|
+
# Linux
|
13
|
+
#
|
14
|
+
# DEPENDENCIES:
|
15
|
+
# gem: sensu-plugin
|
16
|
+
#
|
17
|
+
# USAGE:
|
18
|
+
# check-uptime.rb --help
|
19
|
+
#
|
20
|
+
# NOTES:
|
21
|
+
# Checks the systems uptime and warns if the system has been rebooted.
|
22
|
+
#
|
23
|
+
# LICENSE:
|
24
|
+
# Copyright 2012 Kees Remmelzwaal <kees@fastmail.com>
|
25
|
+
# Released under the same terms as Sensu (the MIT license); see LICENSE
|
26
|
+
# for details.
|
27
|
+
#
|
28
|
+
|
29
|
+
require 'sensu-plugin/check/cli'
|
30
|
+
|
31
|
+
class CheckUptime < Sensu::Plugin::Check::CLI
|
32
|
+
option :warn,
|
33
|
+
short: '-w SEC ',
|
34
|
+
description: 'Warn if uptime is below SEC',
|
35
|
+
proc: proc(&:to_i),
|
36
|
+
default: 180
|
37
|
+
|
38
|
+
def run
|
39
|
+
uptime_sec = IO.read('/proc/uptime').split[0].to_i
|
40
|
+
uptime_date = Time.now - uptime_sec
|
41
|
+
|
42
|
+
if uptime_sec < config[:warn]
|
43
|
+
message "System boot detected (#{uptime_sec} seconds up)"
|
44
|
+
warning
|
45
|
+
end
|
46
|
+
|
47
|
+
message "System booted at #{uptime_date}"
|
48
|
+
ok
|
49
|
+
end
|
50
|
+
end
|
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.1.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: 2016-
|
11
|
+
date: 2016-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sensu-plugin
|
@@ -155,6 +155,7 @@ description: |-
|
|
155
155
|
for metrics collection, including: uptime and idletime metrics
|
156
156
|
email: "<sensu-users@googlegroups.com>"
|
157
157
|
executables:
|
158
|
+
- check-uptime.rb
|
158
159
|
- metrics-uptime.rb
|
159
160
|
extensions: []
|
160
161
|
extra_rdoc_files: []
|
@@ -162,6 +163,7 @@ files:
|
|
162
163
|
- CHANGELOG.md
|
163
164
|
- LICENSE
|
164
165
|
- README.md
|
166
|
+
- bin/check-uptime.rb
|
165
167
|
- bin/metrics-uptime.py
|
166
168
|
- bin/metrics-uptime.rb
|
167
169
|
- lib/sensu-plugins-uptime-checks.rb
|
@@ -192,9 +194,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
194
|
version: '0'
|
193
195
|
requirements: []
|
194
196
|
rubyforge_project:
|
195
|
-
rubygems_version: 2.5
|
197
|
+
rubygems_version: 2.4.5
|
196
198
|
signing_key:
|
197
199
|
specification_version: 4
|
198
200
|
summary: Sensu plugins for uptime-checks
|
199
201
|
test_files: []
|
200
|
-
has_rdoc:
|