sensu-plugins-uptime-checks 1.0.0 → 1.1.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: 1ce634622f80f02f9ebb04130bbf5cbb5236e05c
4
- data.tar.gz: 15e8bffb0636994e093a01200cddee747938f1f5
3
+ metadata.gz: 702c64d7ec1427518c418239293797d8acb08734
4
+ data.tar.gz: fe76e8f2c124abeb690585eeb33e75b18463dff2
5
5
  SHA512:
6
- metadata.gz: ca9d34af539dd97bd0fccbb0323fd8669fe7bb357cb23e8dbc3295fdfcceb065d2f088d7f5bba0cb940fe0369f307c6cb24a07f52fea26adbe5d8e8602f1e942
7
- data.tar.gz: 740c5a293ee0f42338a5c8d2784a514a2ca6813b6a3e9e2e5eddd86efc4453503d964f27526780fc2605138525b1269b02628e69eced7ea9a952ded49dba5d7b
6
+ metadata.gz: 78846540e8536c32caa30852535f9af90cc1582ff563fc72196cf75bf089ce33225b627c48da3507d2a5c6a1b6d0aab9a986c66112a63313afbbb99326093941
7
+ data.tar.gz: a0c7651ba6fe0c799e75fff001f171b98abf0e37592f29919bf58b2d3ecba17aff788de820d37f95fd536e822eec5151527eb7ad0e2f39384666ac1ccf335c94
@@ -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.0.0...HEAD
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
@@ -9,6 +9,7 @@
9
9
  ## Functionality
10
10
 
11
11
  ## Files
12
+ * bin/check-uptime.rb
12
13
  * bin/metrics-uptime.rb
13
14
 
14
15
  ## Usage
@@ -18,3 +19,4 @@
18
19
  [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
19
20
 
20
21
  ## Notes
22
+
@@ -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
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsUptimeChecks
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 0
4
+ MINOR = 1
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.0.0
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-06-17 00:00:00.000000000 Z
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.1
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: