elesai 0.9.2 → 0.9.3

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.
Files changed (3) hide show
  1. data/lib/elesai/cli.rb +14 -7
  2. data/lib/elesai/version.rb +1 -1
  3. metadata +2 -2
data/lib/elesai/cli.rb CHANGED
@@ -188,12 +188,14 @@ module Elesai
188
188
  end
189
189
 
190
190
  @lsi.bbus.each do |bbu|
191
+
191
192
  [:voltage, :temperature, :learncyclestatus].each do |attr|
192
193
  unless bbu[:firmwarestatus][attr] == 'OK'
193
194
  plugin_output += " [BBU:#{bbu._id}:#{attr}:#{bbu[:firmwarestatus][attr]}]"
194
195
  plugin_status = :warning if plugin_status == ""
195
196
  end
196
197
  end
198
+
197
199
  [:batterypackmissing, :batteryreplacementrequired].each do |attr|
198
200
  unless bbu[:firmwarestatus][attr] == 'No'
199
201
  plugin_output += " [BBU:#{attr}:#{bbu[:firmwarestatus][attr]}]"
@@ -202,14 +204,19 @@ module Elesai
202
204
  end
203
205
 
204
206
  if bbu[:batterytype] == 'iBBU'
205
- if bbu[:gasgaugestatus][:absolutestateofcharge].number <= 50
207
+ if bbu[:firmwarestatus][:learncycleactive] == 'Yes'
206
208
  plugin_output += " [BBU:absolutestateofcharge:#{bbu[:gasgaugestatus][:absolutestateofcharge]}]"
207
- plugin_status = :warning if plugin_status == ""
208
- end
209
-
210
- if bbu[:capacityinfo][:remainingcapacity].number <= bbu[:capacityinfo][:remainingcapacityalarm].number
211
- plugin_output += " [BBU:remainingcapacity:#{bbu[:capacityinfo][:remainingcapacityalarm]}]"
212
- plugin_status = :warning if plugin_status == ""
209
+ else
210
+ if bbu[:firmwarestatus][:chargingstatus] == 'None'
211
+ if bbu[:gasgaugestatus][:absolutestateofcharge].number <= 65
212
+ plugin_output += " [BBU:absolutestateofcharge:#{bbu[:gasgaugestatus][:absolutestateofcharge]}]"
213
+ plugin_status = :warning if plugin_status == ""
214
+ end
215
+ if bbu[:capacityinfo][:remainingcapacity].number <= bbu[:capacityinfo][:remainingcapacityalarm].number
216
+ plugin_output += " [BBU:remainingcapacity:#{bbu[:capacityinfo][:remainingcapacityalarm]}]"
217
+ plugin_status = :warning if plugin_status == ""
218
+ end
219
+ end
213
220
  end
214
221
  end
215
222
  end
@@ -1,3 +1,3 @@
1
1
  module Elesai
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elesai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-09 00:00:00.000000000 Z
12
+ date: 2012-11-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: workflow