riemann-nut 1.0.0 → 1.0.1

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
  SHA256:
3
- metadata.gz: f61ed52eeeb5f1be97e103f3637e2b7a176badd16efbde71431ae3bfce608338
4
- data.tar.gz: eb1e03ef41684f4e651c65fe5c66582e6969c72de0d54ede0642968e406b035e
3
+ metadata.gz: c8d999a380da9285d3c39a59292c682402d97915dbb1a306a1bc84184131356d
4
+ data.tar.gz: 3d82e598d164b145d184bacd822b9a6322215d39f2cb4cd9a0e3e82d7fcf13db
5
5
  SHA512:
6
- metadata.gz: e4457b8cbd057b69f8f78e760b33843f24804d670ed499afac16ffe6ca21fa465f8c092031b0ffa8ab78ebe024c057e04dee44e9e395fc5607cbc7d411728fc0
7
- data.tar.gz: da71e8f350b87e68722f224f20323f102ea1ca668dbd1f6a1e263cb1748ade1096647edcd6e8d96497aedc4d50aa7a3f0411c5609f0938a3c6769ff44b35b72c
6
+ metadata.gz: 10d8b47a8b3ee1bb77474e33002589c7e63e1b4fce440e0b4ee660f67f2b0c48a86c984d5c94473013fc16dcd3eb983cc74c9537af1e2a836fa0a135ad297d97
7
+ data.tar.gz: 6a6ef233519ae9aa635094ddb17fa6dde70420eea80a5cee45b71a592908e6cba779d9caed4a8d96ef80a5697c5a28b91d695967953e4bca2a64c8965572d2b5
@@ -0,0 +1,4 @@
1
+ # DO NOT EDIT THIS FILE!
2
+ # This file is managed by ModuleSync.
3
+
4
+ * @opus-codium/core
data/CHANGELOG.md ADDED
@@ -0,0 +1,14 @@
1
+ # Changelog
2
+
3
+ ## [1.0.1](https://github.com/opus-codium/riemann-nut/tree/1.0.1) (2022-08-08)
4
+
5
+ [Full Changelog](https://github.com/opus-codium/riemann-nut/compare/v1.0.0...1.0.1)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - Do not report an alarm if none is set [\#2](https://github.com/opus-codium/riemann-nut/pull/2) ([smortex](https://github.com/smortex))
10
+ - Report charge when no threshold is set [\#1](https://github.com/opus-codium/riemann-nut/pull/1) ([smortex](https://github.com/smortex))
11
+
12
+
13
+
14
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Rakefile CHANGED
@@ -11,4 +11,5 @@ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
11
11
  config.project = 'riemann-nut'
12
12
  config.exclude_labels = ['skip-changelog']
13
13
  config.future_release = Riemann::Tools::Nut::VERSION
14
+ config.since_tag = 'v1.0.0'
14
15
  end
@@ -3,7 +3,7 @@
3
3
  module Riemann
4
4
  module Tools # :nodoc:
5
5
  class Nut
6
- VERSION = '1.0.0'
6
+ VERSION = '1.0.1'
7
7
  end
8
8
  end
9
9
  end
@@ -58,9 +58,9 @@ module Riemann
58
58
  opts[:ups].each do |ups|
59
59
  service = "#{ups} battery charge"
60
60
  battery_charge = Integer(upsc[ups]['battery.charge'])
61
- battery_state = if battery_charge < Integer(upsc[ups]['battery.charge.low'])
61
+ battery_state = if battery_charge < upsc[ups]['battery.charge.low'].to_i
62
62
  'critical'
63
- elsif battery_charge < Integer(upsc[ups]['battery.charge.warning'])
63
+ elsif battery_charge < upsc[ups]['battery.charge.warning'].to_i
64
64
  'warning'
65
65
  else
66
66
  'ok'
@@ -120,6 +120,8 @@ module Riemann
120
120
 
121
121
  def report_ups_alarm
122
122
  opts[:ups].each do |ups|
123
+ next unless upsc[ups]['ups.alarm']
124
+
123
125
  report(
124
126
  service: "#{ups} ups alarm",
125
127
  state: 'critical',
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riemann-nut
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain Tartière
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-26 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: riemann-tools
@@ -116,10 +116,12 @@ executables:
116
116
  extensions: []
117
117
  extra_rdoc_files: []
118
118
  files:
119
+ - ".github/CODEOWNERS"
119
120
  - ".github/workflows/ci.yml"
120
121
  - ".gitignore"
121
122
  - ".rspec"
122
123
  - ".rubocop.yml"
124
+ - CHANGELOG.md
123
125
  - Gemfile
124
126
  - README.md
125
127
  - Rakefile
@@ -150,7 +152,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
152
  - !ruby/object:Gem::Version
151
153
  version: '0'
152
154
  requirements: []
153
- rubygems_version: 3.3.17
155
+ rubygems_version: 3.3.19
154
156
  signing_key:
155
157
  specification_version: 4
156
158
  summary: Submits nut information to riemann