liebert 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/bin/liebert +10 -0
- data/lib/liebert/airconditioner.rb +25 -0
- data/lib/liebert/scrapable.rb +29 -0
- data/lib/liebert/ups.rb +33 -0
- data/lib/liebert/version.rb +3 -0
- data/lib/liebert.rb +12 -0
- data/liebert.gemspec +30 -0
- data/spec/airconditioner_spec.rb +21 -0
- data/spec/cassettes/airconditioner.yml +175 -0
- data/spec/cassettes/ups.yml +273 -0
- data/spec/spec_helper.rb +23 -0
- data/spec/support/vcr.rb +6 -0
- data/spec/ups_spec.rb +29 -0
- metadata +181 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 98e05ff2de3c77d7a10f2d974236bb2708073d98
|
4
|
+
data.tar.gz: c2b820e320e303b16e7f54d9f9423dd9b6e0cc46
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: cd3f5caa8801bfe53218607ecc881961332b284dab5da6b745d0b739c918ff5691863d2f86f625831934340688622ab57f3567be135f05b72881f3c7600132ce
|
7
|
+
data.tar.gz: ecf45fd8881a0b0e191c281bb7dda8dd0ff1d36e8a16eb6411ff7a6f82fbff0adf250b1626c7580b8c9ccdee7ceffa8f2601e7598dcafee83dca4c1efa48d74d
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Brooks Swinnerton
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Liebert
|
2
|
+
|
3
|
+
Liebert is a gem that allows you to gather metrics from Liebert based products and display them in a format digestable by Ganglia.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'liebert'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install liebert
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
To utilize this gem, simply set the URLs to your liebert products in environment variables:
|
22
|
+
|
23
|
+
AC Unit:
|
24
|
+
```
|
25
|
+
export LIEBERT_AIRCONDITIONER_URI='http://liebertac.mydomain.com/graphic/env.htm'
|
26
|
+
```
|
27
|
+
|
28
|
+
UPS Unit:
|
29
|
+
```
|
30
|
+
export LIEBERT_UPS_URI='http://liebertups.mydomain.com/graphic/smallUps.htm'
|
31
|
+
```
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
1. Fork it
|
36
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
37
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
38
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
39
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/liebert
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
require_relative 'scrapable'
|
2
|
+
|
3
|
+
class AirConditioner
|
4
|
+
attr_accessor :endpoint_uri
|
5
|
+
ATTRS = %i(temperature humidity)
|
6
|
+
|
7
|
+
include Scrapable
|
8
|
+
|
9
|
+
def initialize(endpoint_uri)
|
10
|
+
@endpoint_uri = endpoint_uri
|
11
|
+
|
12
|
+
create_getters
|
13
|
+
if get_webpage
|
14
|
+
ATTRS.each { |attr| eval "scrape_#{attr}" }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def scrape_temperature
|
19
|
+
@temperature = @parsed_response.xpath('/*/script[2]').children.text.match(/deviceInfo\.temp=(\d.*);/)[1].to_f
|
20
|
+
end
|
21
|
+
|
22
|
+
def scrape_humidity
|
23
|
+
@humidity = @parsed_response.xpath('/*/script[2]').children.text.match(/deviceInfo\.humid=(\d.*);/)[1].to_f
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'rest-client'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module Scrapable
|
5
|
+
# Create a summary of all attributes and values in a format digestable by Ganglia
|
6
|
+
def all
|
7
|
+
self.class::ATTRS.inject(String.new) do |string, attr|
|
8
|
+
string << "#{attr.capitalize}\t#{eval("@#{attr}")}\n"
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
# Dynamically create custom getters for each attribute that displays in a format digestable by Ganglia
|
13
|
+
def create_getters
|
14
|
+
self.class::ATTRS.each do |method_name|
|
15
|
+
self.class.class_eval do
|
16
|
+
define_method(method_name) do
|
17
|
+
"#{method_name.capitalize}\t#{eval("@#{method_name}")}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def get_webpage
|
26
|
+
response = RestClient.get(self.endpoint_uri)
|
27
|
+
@parsed_response = Nokogiri::HTML.parse(response.body)
|
28
|
+
end
|
29
|
+
end
|
data/lib/liebert/ups.rb
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
require_relative 'scrapable'
|
2
|
+
|
3
|
+
class UPS
|
4
|
+
attr_accessor :endpoint_uri
|
5
|
+
ATTRS = %i(input_amps output_amps battery_voltage charge)
|
6
|
+
|
7
|
+
include Scrapable
|
8
|
+
|
9
|
+
def initialize(endpoint_uri)
|
10
|
+
@endpoint_uri = endpoint_uri
|
11
|
+
|
12
|
+
create_getters
|
13
|
+
if get_webpage
|
14
|
+
ATTRS.each { |attr| eval "scrape_#{attr}" }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def scrape_input_amps
|
19
|
+
@input_amps = @parsed_response.xpath('//*[@id="InputAmps"]/td[2]').children.text.match(/(\d.*)/)[1].strip.to_f
|
20
|
+
end
|
21
|
+
|
22
|
+
def scrape_output_amps
|
23
|
+
@output_amps = @parsed_response.xpath('//*[@id="OutputAmps"]/td[2]').children.text.match(/(\d.*)/)[1].strip.to_f
|
24
|
+
end
|
25
|
+
|
26
|
+
def scrape_battery_voltage
|
27
|
+
@battery_voltage = @parsed_response.xpath('//*[@id="Battery"]/table/tr/td/center/table/tr[1]/td[2]').children.text.match(/(\d.*)/)[1].strip.to_f
|
28
|
+
end
|
29
|
+
|
30
|
+
def scrape_charge
|
31
|
+
@charge = @parsed_response.xpath('//*[@id="Battery"]/table/tr/td/center/table/tr[3]/td[2]').children.text.match(/(\d.*)/)[1].strip.to_f
|
32
|
+
end
|
33
|
+
end
|
data/lib/liebert.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'liebert/version'
|
2
|
+
require 'liebert/airconditioner'
|
3
|
+
require 'liebert/ups'
|
4
|
+
|
5
|
+
# For each argument passed, see if the object responds to a method of that name
|
6
|
+
def pass_arguments(object)
|
7
|
+
ARGV.each do |arg|
|
8
|
+
sanitized_arg = arg.gsub('--', '')
|
9
|
+
puts object.send(sanitized_arg.to_sym) if object.respond_to? sanitized_arg
|
10
|
+
end
|
11
|
+
puts object.all if ARGV[1].nil?
|
12
|
+
end
|
data/liebert.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'liebert/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'liebert'
|
8
|
+
spec.version = Liebert::VERSION
|
9
|
+
spec.authors = ['Brooks Swinnerton']
|
10
|
+
spec.email = ['bswinnerton@gmail.com']
|
11
|
+
spec.description = %q{A gem to gather metrics from Liebert products with a web interface}
|
12
|
+
spec.summary = %q{A gem to gather metrics from Liebert products with a web interface}
|
13
|
+
spec.homepage = 'https://github.com/bswinnerton/liebert'
|
14
|
+
spec.license = 'MIT'
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency 'bundler', '~> 1.3'
|
22
|
+
spec.add_development_dependency 'rake'
|
23
|
+
spec.add_development_dependency 'pry'
|
24
|
+
spec.add_development_dependency 'rspec'
|
25
|
+
spec.add_development_dependency 'webmock', '~> 1.15.0'
|
26
|
+
spec.add_development_dependency 'vcr'
|
27
|
+
|
28
|
+
spec.add_runtime_dependency 'rest-client'
|
29
|
+
spec.add_runtime_dependency 'nokogiri'
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe AirConditioner do
|
4
|
+
before :all do
|
5
|
+
VCR.use_cassette 'airconditioner' do
|
6
|
+
@ac = AirConditioner.new(ENV['LIEBERT_AIRCONDITIONER_URI'])
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'responds to temperature' do
|
11
|
+
expect(@ac.temperature).to eq "Temperature\t65.0"
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to humidity' do
|
15
|
+
expect(@ac.humidity).to eq "Humidity\t48.0"
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'responds to all' do
|
19
|
+
expect(@ac.all).to eq "Temperature\t65.0\nHumidity\t48.0\n"
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: <AIRCONDITIONER_URI>
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/html
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache
|
25
|
+
Expires:
|
26
|
+
- Thu, 26 Oct 1995 00:00:00 GMT
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Server:
|
30
|
+
- Allegro-Software-RomPager/4.30
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
<html><head>
|
35
|
+
<link rel="stylesheet" type="text/css" href="../rightPanelStyle.css">
|
36
|
+
<link rel="stylesheet" type="text/css" href="../powerFlowStyle.css">
|
37
|
+
<style type="text/css">
|
38
|
+
.areaTitleStyle { font-size:12px; }
|
39
|
+
.defaultTableStyle { font-size:9px;}
|
40
|
+
.graphTableFont { font-size:9px; color:blue; }
|
41
|
+
.blueTextStyle { font-size:12px; color:blue; }
|
42
|
+
.blackTextStyle { font-size:12px; color:black; }
|
43
|
+
.grayTextStyle { font-size:12px; color:gray; }
|
44
|
+
.rightAlignAreaStyle { font-size:14px; color:black; font-weight:bold; text-align:right; }
|
45
|
+
.leftAlignAreaStyle { font-size:14px; color:black; font-weight:bold; text-align:left; }
|
46
|
+
|
47
|
+
.identPanelArea { background:#31659c; position: absolute; visibility: visible; top: 0px; left: 0px; }
|
48
|
+
.alarmPanelArea { background:#31659c; position: absolute; visibility: visible; top: 270px; left: 0px; }
|
49
|
+
|
50
|
+
.temperatureFrame {position: absolute; visibility: visible; top: 35px; left: 5px; z-index: 1; }
|
51
|
+
.humidityFrame {position: absolute; visibility: visible; top: 150px; left: 5px; z-index: 1; }
|
52
|
+
.temperatureArea {position: absolute; visibility: visible; top: 45px; left: 15px; z-index: 1; }
|
53
|
+
.temperatureGraphAreaMinus {position: absolute; visibility: hidden; top: 63px; left: 172px; z-index: 1; }
|
54
|
+
.temperatureGraphAreaSpt {position: absolute; visibility: hidden; top: 60px; left: 220px; z-index: 1; }
|
55
|
+
.temperatureGraphAreaPlus {position: absolute; visibility: hidden; top: 63px; left: 270px; z-index: 1; }
|
56
|
+
.temperatureGraph {position: absolute; visibility: hidden; top: 82px; left: 150px; z-index: 2; }
|
57
|
+
.temperatureBar {position: absolute; visibility: hidden; top: 82px; left: 150px; z-index: 1; }
|
58
|
+
.temperatureBarOTLow {position: absolute; visibility: hidden; top: 82px; left: 150px; z-index: 1; }
|
59
|
+
.temperatureBarOTHigh {position: absolute; visibility: hidden; top: 82px; left: 280px; z-index: 1; }
|
60
|
+
|
61
|
+
.stageInfoArea {position: absolute; visibility: visible; top: 60px; left: 510px; z-index: 1; }
|
62
|
+
|
63
|
+
.humidityArea {position: absolute; visibility: visible; top: 160px; left: 30px; z-index: 1; }
|
64
|
+
.humidityGraphAreaMinus {position: absolute; visibility: hidden; top: 183px; left: 172px; z-index: 1; }
|
65
|
+
.humidityGraphAreaSpt {position: absolute; visibility: hidden; top: 180px; left: 220px; z-index: 1; }
|
66
|
+
.humidityGraphAreaPlus {position: absolute; visibility: hidden; top: 183px; left: 270px; z-index: 1; }
|
67
|
+
.humidityGraph {position: absolute; visibility: hidden; top: 200px; left: 150px; z-index: 2; }
|
68
|
+
.humidityBar {position: absolute; visibility: hidden; top: 200px; left: 150px; z-index: 1; }
|
69
|
+
.humidityBarOTLow {position: absolute; visibility: hidden; top: 200px; left: 150px; z-index: 1; }
|
70
|
+
.humidityBarOTHigh {position: absolute; visibility: hidden; top: 200px; left: 280px; z-index: 1; }
|
71
|
+
|
72
|
+
.temperatureSetpointRow { visibility: hidden }
|
73
|
+
.temperatureToleranceRow { visibility: hidden }
|
74
|
+
|
75
|
+
.humiditySetpointRow { visibility: hidden }
|
76
|
+
.humidityToleranceRow { visibility: hidden }
|
77
|
+
|
78
|
+
.deviceCooling {position: absolute; visibility: hidden; top: 45px; left: 320px; z-index: 10; }
|
79
|
+
.deviceHeating {position: absolute; visibility: hidden; top: 45px; left: 400px; z-index: 10; }
|
80
|
+
|
81
|
+
.deviceHumidify {position: absolute; visibility: hidden; top: 160px; left: 320px; z-index: 10; }
|
82
|
+
.deviceDehumidify {position: absolute; visibility: hidden; top: 160px; left: 400px; z-index: 10; }
|
83
|
+
|
84
|
+
.deviceEconCycle {position: absolute; visibility: hidden; top: 160px; left: 500px; z-index: 10; }
|
85
|
+
.deviceUnitOn {position: absolute; visibility: hidden; top: 160px; left: 580px; z-index: 10; }
|
86
|
+
|
87
|
+
</style>
|
88
|
+
<meta name="Pragma" content="no-cache">
|
89
|
+
<meta name="generator" content="Liebert Corporation 2000-2010">
|
90
|
+
<meta http-equiv="refresh" content="30;URL=../graphic/env.htm">
|
91
|
+
<base target="detailArea">
|
92
|
+
</head><script language="JavaScript" type="text/javascript" src="../genPurpose_js.js"></script>
|
93
|
+
<script language="JavaScript" type="text/javascript">
|
94
|
+
<!--
|
95
|
+
// Assign deviceInfo defaults:
|
96
|
+
var deviceInfo = new Object();
|
97
|
+
|
98
|
+
deviceInfo.type="LAM";
|
99
|
+
deviceInfo.moduleId="1";
|
100
|
+
|
101
|
+
var tempScales = new Array
|
102
|
+
(
|
103
|
+
"F",
|
104
|
+
"C"
|
105
|
+
);
|
106
|
+
|
107
|
+
|
108
|
+
deviceInfo.type="LMD_UNIT_AMAG";
|
109
|
+
|
110
|
+
deviceInfo.cooling=true;
|
111
|
+
deviceInfo.heating=false;
|
112
|
+
|
113
|
+
deviceInfo.humidify=false;
|
114
|
+
deviceInfo.dehumidify=true;
|
115
|
+
|
116
|
+
deviceInfo.econCycle=false;
|
117
|
+
deviceInfo.unitOn=true;
|
118
|
+
|
119
|
+
deviceInfo.tempUnit=0;
|
120
|
+
deviceInfo.temp=65;
|
121
|
+
deviceInfo.tempSetpt=65;
|
122
|
+
deviceInfo.tempTol=2.0;
|
123
|
+
|
124
|
+
deviceInfo.humid=48;
|
125
|
+
deviceInfo.humidSetpt=48;
|
126
|
+
deviceInfo.humidTol=5;
|
127
|
+
// -->
|
128
|
+
</script>
|
129
|
+
<script language="JavaScript" type="text/javascript" src="env_js.js"></script>
|
130
|
+
<script language="JavaScript" type="text/javascript" src="../dateTime_js.js"></script>
|
131
|
+
</head><body bgcolor="#FFFFFF" onLoad="initPage();" class="defaultTableStyle">
|
132
|
+
<div id="IdentPanelArea" class="identPanelArea">
|
133
|
+
<table border="0" width="660" height="30">
|
134
|
+
<tr>
|
135
|
+
<td class="headerTextStyle" width="250">Summary:</td><td class="headerTextStyle"><nobr>Updated: <script>document.write(condensedDateTimeString(new Date()));</script></nobr></td></tr></table></div><div id="TemperatureFrame" class="temperatureFrame">
|
136
|
+
<table border="1" width="655" height="110">
|
137
|
+
<tr><td> </td></tr></table></div><div id="TemperatureArea" class="temperatureArea">
|
138
|
+
<table border="0" height="90">
|
139
|
+
<tr>
|
140
|
+
<td class="blueTextStyle">Temperature</td><td class="blueTextStyle"><script>document.write(deviceInfo.temp);</script></td><td class="blueTextStyle"><script>document.write(tempScales[deviceInfo.tempUnit]);</script></td></tr><tr id="TemperatureSetpointRow" class="temperatureSetpointRow">
|
141
|
+
<td align=left class="blackTextStyle">Setpoint</td><td class="blackTextStyle"><script>document.write(deviceInfo.tempSetpt);</script></td><td> </td></tr><tr id="TemperatureToleranceRow" class="temperatureToleranceRow">
|
142
|
+
<td class="grayTextStyle">Tolerance</td><td class="grayTextStyle"><script>document.write(deviceInfo.tempTol);</script></td><td> </td></tr></table></div><div id="TemperatureGraphAreaMinus" class="temperatureGraphAreaMinus">
|
143
|
+
<table border="0" class="graphTableFont">
|
144
|
+
<tr><td>-<script>document.write(deviceInfo.tempTol);</script></td></tr></table></div><div id="TemperatureGraphAreaSpt" class="temperatureGraphAreaSpt">
|
145
|
+
<table border="0" class="graphTableFont">
|
146
|
+
<tr><td><b><script>document.write(deviceInfo.tempSetpt);</script></b></td></tr></table></div><div id="TemperatureGraphAreaPlus" class="temperatureGraphAreaPlus">
|
147
|
+
<table border="0" class="graphTableFont">
|
148
|
+
<tr><td>+<script>document.write(deviceInfo.tempTol);</script></td></tr></table></div><div id="TemperatureGraph" class="temperatureGraph"><img width=160 height=16 src="./images/graphBG.gif"></div><div id="TemperatureBar" class="temperatureBar"><img id="TemperatureBarImg" width="1" height="16" src="./images/graphBar.gif"></div><div id="TemperatureBarOTLow" class="temperatureBarOTLow"><img id="TemperatureBarOTLowImg" width="30" height="16" src="./images/marginal.gif"></div><div id="TemperatureBarOTHigh" class="temperatureBarOTHigh"><img id="TemperatureBarOTHighImg" width="30" height="16" src="./images/marginal.gif"></div><div id="StageInfoArea" class="stageInfoArea">
|
149
|
+
<table border="0">
|
150
|
+
<tr>
|
151
|
+
<td class="leftAlignAreaStyle">Stage</td><td class="leftAlignAreaStyle">
|
152
|
+
0 </td></tr><tr>
|
153
|
+
<td class="leftAlignAreaStyle">Capacity </td><td class="leftAlignAreaStyle">
|
154
|
+
30 %
|
155
|
+
</td></tr></table></div><div id="HumidityFrame" class="humidityFrame">
|
156
|
+
<table border="1" width="485" height="110">
|
157
|
+
<tr><td> </td></tr></table></div><div id="HumidityArea" class="humidityArea">
|
158
|
+
<table border="0" height="90">
|
159
|
+
<tr>
|
160
|
+
<td align=right class="blueTextStyle">Humidity</td><td class="blueTextStyle"><script>document.write(deviceInfo.humid);</script></td><td align=left class="blueTextStyle">%</td></tr><tr id="HumiditySetpointRow" class="humiditySetpointRow">
|
161
|
+
<td align=right class="blackTextStyle">Setpoint</td><td class="blackTextStyle"><script>document.write(deviceInfo.humidSetpt);</script></td><td> </td></tr><tr id="HumidityToleranceRow" class="humidityToleranceRow">
|
162
|
+
<td align=right class="grayTextStyle">Tolerance</td><td class="grayTextStyle"><script>document.write(deviceInfo.humidTol);</script></td><td> </td></tr></table></div><div id="HumidityGraphAreaMinus" class="humidityGraphAreaMinus">
|
163
|
+
<table border="0" class="graphTableFont">
|
164
|
+
<tr><td>-<script>document.write(deviceInfo.humidTol);</script></td></tr></table></div><div id="HumidityGraphAreaSpt" class="humidityGraphAreaSpt">
|
165
|
+
<table border="0" class="graphTableFont">
|
166
|
+
<tr><td><b><script>document.write(deviceInfo.humidSetpt);</script></b></td></tr></table></div><div id="HumidityGraphAreaPlus" class="humidityGraphAreaPlus">
|
167
|
+
<table border="0" class="graphTableFont">
|
168
|
+
<tr><td>+<script>document.write(deviceInfo.humidTol);</script></td></tr></table></div><div id="HumidityGraph" class="humidityGraph"><img width=160 height=16 src="./images/graphBG.gif"></div><div id="HumidityBar" class="humidityBar"><img id="HumidityBarImg" width="1" height="16" src="./images/graphBar.gif"></div><div id="HumidityBarOTLow" class="humidityBarOTLow"><img id="HumidityBarOTLowImg" width="30" height="16" src="./images/marginal.gif"></div><div id="HumidityBarOTHigh" class="humidityBarOTHigh"><img id="HumidityBarOTHighImg" width="30" height="16" src="./images/marginal.gif"></div><div id="Cooling" class="deviceCooling"><img src="./images/cooling.gif"></div><div id="Heating" class="deviceHeating"><img src="./images/heating.gif"></div><div id="Humidify" class="deviceHumidify"><img src="./images/humidify.gif"></div><div id="Dehumidify" class="deviceDehumidify"><img src="./images/dehumidify.gif"></div><div id="EconCycle" class="deviceEconCycle"><img src="./images/econCycle.gif"></div><div id="UnitOn" class="deviceUnitOn"><img src="./images/unitOn.gif"></div><div id="AlarmPanelArea" class="alarmPanelArea">
|
169
|
+
<table border="0" width="660" height="30">
|
170
|
+
<tr>
|
171
|
+
<td class="headerTextStyle" width="250">Active Alarms:</td></tr></table></div>
|
172
|
+
</body></html>
|
173
|
+
http_version:
|
174
|
+
recorded_at: Thu, 05 Dec 2013 17:09:54 GMT
|
175
|
+
recorded_with: VCR 2.8.0
|
@@ -0,0 +1,273 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: <UPS_URI>
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept:
|
11
|
+
- '*/*; q=0.5, application/xml'
|
12
|
+
Accept-Encoding:
|
13
|
+
- gzip, deflate
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: OK
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- text/html
|
23
|
+
Cache-Control:
|
24
|
+
- no-cache
|
25
|
+
Expires:
|
26
|
+
- Thu, 26 Oct 1995 00:00:00 GMT
|
27
|
+
Transfer-Encoding:
|
28
|
+
- chunked
|
29
|
+
Server:
|
30
|
+
- Allegro-Software-RomPager/4.30
|
31
|
+
body:
|
32
|
+
encoding: UTF-8
|
33
|
+
string: |-
|
34
|
+
<html><head>
|
35
|
+
<link rel="stylesheet" type="text/css" href="../rightPanelStyle.css">
|
36
|
+
<link rel="stylesheet" type="text/css" href="../powerFlowStyle.css">
|
37
|
+
<style type="text/css">
|
38
|
+
.identPanelArea { background:#31659c; position: absolute; visibility: visible; top: 0px; left: 0px; }
|
39
|
+
.alarmPanelArea { background:#31659c; position: absolute; visibility: visible; top: 385px; left: 0px; }
|
40
|
+
.monitorFrame {position: absolute; visibility: visible; top: 37px; left: 5px; z-index: 1; }
|
41
|
+
|
42
|
+
.upsBypassArea {position: absolute; visibility: hidden; top: 85px; left: 152px; z-index: 1; }
|
43
|
+
.upsInputTeeToLElbow {position: absolute; visibility: visible; top: 90px; left: 118px; z-index: 10; }
|
44
|
+
.upsLeftElbow {position: absolute; visibility: visible; top: 70px; left: 116px; z-index: 1; }
|
45
|
+
.upsLElbowToRElbow {position: absolute; visibility: visible; top: 72px; left: 136px; z-index: 10; }
|
46
|
+
.upsRightElbow {position: absolute; visibility: visible; top: 70px; left: 313px; z-index: 1; }
|
47
|
+
.upsRElbowToOutputTee {position: absolute; visibility: visible; top: 90px; left: 321px; z-index: 10; }
|
48
|
+
|
49
|
+
.upsInputArea {position: absolute; visibility: visible; top: 200px; left: 15px; z-index: 1; }
|
50
|
+
.upsInputToInputMeter {position: absolute; visibility: visible; top: 173px; left: 15px; z-index: 10; }
|
51
|
+
.upsInputMeter {position: absolute; visibility: visible; top: 163px; left: 50px; z-index: 1; }
|
52
|
+
.upsInputMeterToInputTee {position: absolute; visibility: visible; top: 173px; left: 91px; z-index: 10; }
|
53
|
+
.upsInputTee {position: absolute; visibility: visible; top: 165px; left: 110px; z-index: 1; }
|
54
|
+
.upsInputNoTee {position: absolute; visibility: visible; top: 173px; left: 110px; z-index: 1; }
|
55
|
+
.upsInputTeeToRectifier {position: absolute; visibility: visible; top: 173px; left: 136px; z-index: 10; }
|
56
|
+
|
57
|
+
.upsOutputArea {position: absolute; visibility: visible; top: 200px; left: 300px; z-index: 1; }
|
58
|
+
.upsInverterToOutputTee {position: absolute; visibility: visible; top: 173px; left: 294px; z-index: 10; }
|
59
|
+
.upsOutputTee {position: absolute; visibility: visible; top: 165px; left: 314px; z-index: 1; }
|
60
|
+
.upsOutputNoTee {position: absolute; visibility: visible; top: 173px; left: 314px; z-index: 1; }
|
61
|
+
.upsOutputTeeToOutputMeter {position: absolute; visibility: visible; top: 173px; left: 340px; z-index: 10; }
|
62
|
+
.upsOutputMeter {position: absolute; visibility: visible; top: 163px; left: 361px; z-index: 1; }
|
63
|
+
.upsOutputMeterToOutput {position: absolute; visibility: visible; top: 173px; left: 402px; z-index: 10; }
|
64
|
+
|
65
|
+
.upsBatteryArea {position: absolute; visibility: visible; top: 280px; left: 60px; z-index: 1; }
|
66
|
+
.upsBatteryImage {position: absolute; visibility: visible; top: 293px; left: 205px; z-index: 1; }
|
67
|
+
.upsBatteryMeter {position: absolute; visibility: visible; top: 226px; left: 205px; z-index: 1; }
|
68
|
+
.upsRectifierToBatteryTee {position: absolute; visibility: visible; top: 173px; left: 191px; z-index: 10; }
|
69
|
+
.upsBatteryTee {position: absolute; visibility: visible; top: 171px; left: 212px; z-index: 1; }
|
70
|
+
.upsBatteryTeeToInverter {position: absolute; visibility: visible; top: 173px; left: 238px; z-index: 10; }
|
71
|
+
.upsBatteryTeeToBatteryMeter {position: absolute; visibility: visible; top: 191px; left: 220px; z-index: 10; }
|
72
|
+
.upsBatteryMeterToBattery {position: absolute; visibility: visible; top: 258px; left: 220px; z-index: 1; }
|
73
|
+
|
74
|
+
.upsRectifier {position: absolute; visibility: visible; top: 163px; left: 157px; z-index: 10; }
|
75
|
+
.upsInverter {position: absolute; visibility: visible; top: 163px; left: 260px; z-index: 10; }
|
76
|
+
|
77
|
+
.userSpecifiedDataArea {position: absolute; visibility: hidden; top: 37px; left: 480px; z-index: 1; }
|
78
|
+
|
79
|
+
.inputAmps {visibility: visible;}
|
80
|
+
.bypassAmps {visibility: visible;}
|
81
|
+
.batteryAmps {visibility: visible;}
|
82
|
+
.outputAmps {visibility: visible;}
|
83
|
+
.loadPercent {visibility: visible;}
|
84
|
+
.loadVA {visibility: visible;}
|
85
|
+
.loadWatt {visibility: visible;}
|
86
|
+
.outputFreq {visibility: visible;}
|
87
|
+
</style>
|
88
|
+
<script language="JavaScript" type="text/javascript" src="../genPurpose_js.js"></script>
|
89
|
+
<script language="JavaScript" type="text/javascript">
|
90
|
+
<!--
|
91
|
+
// Assign deviceInfo defaults:
|
92
|
+
var deviceInfo = new Object();
|
93
|
+
|
94
|
+
// Also call LmdGetDeviceIdent to get val_SysManDevIDCode for deviceId
|
95
|
+
|
96
|
+
// Logical combo:isOnLine = !isLineInteractive && !isOffLine
|
97
|
+
//deviceInfo.isOnLine=true;
|
98
|
+
|
99
|
+
|
100
|
+
deviceInfo.hasBypassData=true;
|
101
|
+
deviceInfo.utilityFailed=false;
|
102
|
+
deviceInfo.onBattery=false;
|
103
|
+
|
104
|
+
;
|
105
|
+
;
|
106
|
+
;
|
107
|
+
;
|
108
|
+
;
|
109
|
+
;
|
110
|
+
;
|
111
|
+
;
|
112
|
+
|
113
|
+
;
|
114
|
+
;
|
115
|
+
;
|
116
|
+
;
|
117
|
+
|
118
|
+
;
|
119
|
+
;
|
120
|
+
;
|
121
|
+
;
|
122
|
+
;
|
123
|
+
|
124
|
+
;
|
125
|
+
;
|
126
|
+
;
|
127
|
+
;
|
128
|
+
;
|
129
|
+
|
130
|
+
;
|
131
|
+
;
|
132
|
+
;
|
133
|
+
|
134
|
+
function showNfinityModuleRow(datapoint,datatext,spacer)
|
135
|
+
{
|
136
|
+
if (typeof datapoint != "undefined")
|
137
|
+
{
|
138
|
+
document.write("<tr><td>" + datapoint + "</td><td>");
|
139
|
+
while(spacer--)
|
140
|
+
{
|
141
|
+
document.write(" ");
|
142
|
+
}
|
143
|
+
document.write("</td><td class=\"unitColumnLeftStyle\"> " + datatext + "</td></tr>");
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
deviceInfo.isOnLine = (!deviceInfo.isLineInteractive && !deviceInfo.isOffLine);
|
148
|
+
deviceInfo.onUtility = !deviceInfo.utilityFailed;
|
149
|
+
|
150
|
+
function getModuleAlarmMsgs ()
|
151
|
+
{
|
152
|
+
var alarmMsg = "";
|
153
|
+
|
154
|
+
// Now do special module mismatch logic
|
155
|
+
if(typeof deviceInfo.mainCtrlFail != "undefined" && deviceInfo.mainCtrlFail)
|
156
|
+
{
|
157
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Control Module Failure</td></tr>";
|
158
|
+
}
|
159
|
+
if(typeof deviceInfo.redunCtrlFail != "undefined" && deviceInfo.redunCtrlFail)
|
160
|
+
{
|
161
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Redundant Control Module Failure</td></tr>";
|
162
|
+
}
|
163
|
+
if(typeof deviceInfo.pwrModFail != "undefined" && deviceInfo.pwrModFail)
|
164
|
+
{
|
165
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Power Module Failure</td></tr>";
|
166
|
+
}
|
167
|
+
if(typeof deviceInfo.batModFail != "undefined" && deviceInfo.batModFail)
|
168
|
+
{
|
169
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Battery Module Failure</td></tr>";
|
170
|
+
}
|
171
|
+
if(typeof deviceInfo.mainCtrlWarn != "undefined" && deviceInfo.mainCtrlWarn)
|
172
|
+
{
|
173
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Control Module Warning</td></tr>";
|
174
|
+
}
|
175
|
+
if(typeof deviceInfo.redunCtrlWarn != "undefined" && deviceInfo.redunCtrlWarn)
|
176
|
+
{
|
177
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Redundant Control Module Warning</td></tr>";
|
178
|
+
}
|
179
|
+
if(typeof deviceInfo.pwrModWarn != "undefined" && deviceInfo.pwrModWarn)
|
180
|
+
{
|
181
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Power Module Warning</td></tr>";
|
182
|
+
}
|
183
|
+
if(typeof deviceInfo.batModWarn != "undefined" && deviceInfo.batModWarn)
|
184
|
+
{
|
185
|
+
alarmMsg = alarmMsg + "<tr><td class=\"tdActiveB\">Battery Module Warning</td></tr>";
|
186
|
+
}
|
187
|
+
return alarmMsg;
|
188
|
+
}
|
189
|
+
// -->
|
190
|
+
</script>
|
191
|
+
<script language="JavaScript" type="text/javascript" src="../graphic/smallUps_js.js"></script>
|
192
|
+
<script language="JavaScript" type="text/javascript" src="../dateTime_js.js"></script>
|
193
|
+
<meta name="Pragma" content="no-cache">
|
194
|
+
<meta name="generator" content="Liebert Corporation 2000-2007">
|
195
|
+
<meta http-equiv="refresh" content="30;URL=../graphic/smallUps.htm">
|
196
|
+
<base target="detailArea">
|
197
|
+
</head><body bgcolor="#ffffff" onLoad="initPage();" class="defaultStyle">
|
198
|
+
<div id="IdentPanelArea" class="identPanelArea">
|
199
|
+
<table border="0" width="660" height="30">
|
200
|
+
<tr>
|
201
|
+
<td class="headerTextStyle" width="250">Summary:</td><td class="headerTextStyle"><nobr>Updated: <script language="JavaScript" type="text/javascript">document.write(condensedDateTimeString(new Date()));</script></nobr></td></tr></table></div><div id="MonitorFrame" class="monitorFrame">
|
202
|
+
<table border="1" width="470" height="340">
|
203
|
+
<tr><td> </td></tr></table></div><div id="Bypass" class="upsBypassArea" style="WIDTH: 147px; HEIGHT: 81px">
|
204
|
+
<table border="1">
|
205
|
+
<tr><td><center>
|
206
|
+
<a href="../monitor/upsBypass.htm"><b>BYPASS</b></a><table border="0" width="135" align=center cellspacing="0" cellpadding="1">
|
207
|
+
<tr>
|
208
|
+
<td>Volts:</td><td></td><td><script language="JavaScript" type="text/javascript">if(deviceInfo.numBypassLines <= 1)document.write("V");</script>
|
209
|
+
</td><td></td><td class="unitColumnStyle"><script language="JavaScript" type="text/javascript">if(deviceInfo.numBypassLines >= 3)document.write("V");</script></td></tr><tr id="BypassAmps" class="bypassAmps">
|
210
|
+
<td>Amps:</td><td></td><td class="unitColumnStyle">A</td></tr><tr>
|
211
|
+
<td>Freq:</td><td>60.0</td><td class="unitColumnStyle">Hz</td></tr></table></center></td></tr></table></div><div id="Input" class="upsInputArea">
|
212
|
+
<table border="1">
|
213
|
+
<tr><td><center>
|
214
|
+
<a href="../monitor/upsInput.htm"><b>INPUT</b></a><table border="0" width="135" align=center cellspacing="0" cellpadding="1">
|
215
|
+
<tr>
|
216
|
+
<td>Volts:</td><td></td><td><script language="JavaScript" type="text/javascript">if(deviceInfo.numInputLines <= 1)document.write("V");</script>
|
217
|
+
</td><td></td><td class="unitColumnStyle"><script language="JavaScript" type="text/javascript">if(deviceInfo.numInputLines >= 3)document.write("V");</script></td></tr><tr id="InputAmps" class="inputAmps">
|
218
|
+
<td>Amps:</td><td>16.5 </td><td class="unitColumnStyle">A</td></tr><tr>
|
219
|
+
<td>Freq:</td><td>60.0 </td><td class="unitColumnStyle">Hz</td></tr></table></center></td></tr></table></div><div id="Output" class="upsOutputArea">
|
220
|
+
<table border="1">
|
221
|
+
<tr><td><center>
|
222
|
+
<a href="../monitor/upsOutput.htm"><b>OUTPUT</b></a><table border="0" width="135" align=center cellspacing="0" cellpadding="1">
|
223
|
+
<tr>
|
224
|
+
<td>Volts:</td><td></td><td><script language="JavaScript" type="text/javascript">if(deviceInfo.numOutputLines <= 1)document.write("V");</script>
|
225
|
+
</td><td></td><td class="unitColumnStyle"><script language="JavaScript" type="text/javascript">if(deviceInfo.numOutputLines >= 3)document.write("V");</script></td></tr><tr id="OutputAmps" class="outputAmps">
|
226
|
+
<td>Amps:</td><td>33.5 </td><td class="unitColumnStyle">A</td></tr><tr id="OutputFreq" class="outputFreq">
|
227
|
+
<td>Freq:</td><td>60.0 </td><td class="unitColumnStyle">Hz</td></tr></table></center></td></tr></table></div><div id="Battery" class="upsBatteryArea">
|
228
|
+
<table border="1">
|
229
|
+
<tr><td><center>
|
230
|
+
<a href="../monitor/upsBattery.htm"><b>BATTERY</b></a><table border="0" width="110" align=center cellspacing="0" cellpadding="1">
|
231
|
+
<tr>
|
232
|
+
<td>Volts:</td><td>548 </td><td class="unitColumnStyle">V</td></tr><tr id="BatteryAmps" class="batteryAmps">
|
233
|
+
<td>Amp:</td><td>0.0 </td><td class="unitColumnStyle">A</td></tr><tr>
|
234
|
+
<td>Charge:</td><td>100 </td><td class="unitColumnStyle">%</td></tr><tr>
|
235
|
+
<td><nobr>Time Remaining:</nobr></td><td> </td><td class="unitColumnStyle">min</td></tr></table></center></td></tr></table></div><div id="AlarmPanelArea" class="alarmPanelArea">
|
236
|
+
<table border="0" width="660" height="30">
|
237
|
+
<tr>
|
238
|
+
<td class="headerTextStyle" width="250">Active Alarms:</td></tr></table></div><div id="Rectifier" class="upsRectifier"><a href="../monitor/upsRectifier.htm"><img src="images/rectifier_30x30.gif"></a></div><div id="Inverter" class="upsInverter"><a href="../monitor/upsInverter.htm"><img src="images/inverter_30x30.gif"></a></div><div id="BatteryImage" class="upsBatteryImage"><img src="images/battery.gif"></div><div id="InputMeter" class="upsInputMeter"><img src="images/meter.gif"></div><div id="InputTee" class="upsInputTee"><img src="images/teeUp.gif"></div><div id="OutputMeter" class="upsOutputMeter"><img src="images/meter.gif"></div><div id="OutputTee" class="upsOutputTee"><img src="images/teeUp.gif"></div><div id="BatteryTee" class="upsBatteryTee"><img src="images/teeDown.gif"></div><div id="BatteryMeter" class="upsBatteryMeter"><img src="images/meter.gif"></div><div id="LeftElbow" class="upsLeftElbow"><img src="images/r_elbow.gif"></div><div id="RightElbow" class="upsRightElbow"><img src="images/l_elbow.gif"></div><div id="InputNoTee" class="upsInputNoTee" ><img id="InputNoTeeImg" height=10 width=35></div><div id="OutputNoTee" class="upsOutputNoTee" ><img id="OutputNoTeeImg" height=10 width=35></div><div id="InputTeeToLElbow" class="upsInputTeeToLElbow" ><img id="InputTeeToLElbowImg" height=75 width=10></div><div id="LElbowToRElbow" class="upsLElbowToRElbow" ><img id="LElbowToRElbowImg" height=10 width=177></div><div id="RElbowToOutputTee" class="upsRElbowToOutputTee" ><img id="RElbowToOutputTeeImg" height=75 width=10></div><div id="InputToInputMeter" class="upsInputToInputMeter" ><img id="InputToInputMeterImg" height=10 width=35></div><div id="InputMeterToInputTee" class="upsInputMeterToInputTee" ><img id="InputMeterToInputTeeImg" height=10 width=20></div><div id="InputTeeToRectifier" class="upsInputTeeToRectifier" ><img id="InputTeeToRectifierImg" height=10 width=20></div><div id="InverterToOutputTee" class="upsInverterToOutputTee" ><img id="InverterToOutputTeeImg" height=10 width=20></div><div id="OutputTeeToOutputMeter" class="upsOutputTeeToOutputMeter" ><img id="OutputTeeToOutputMeterImg" height=10 width=20></div><div id="OutputMeterToOutput" class="upsOutputMeterToOutput" ><img id="OutputMeterToOutputImg" height=10 width=35></div><div id="RectifierToBatteryTee" class="upsRectifierToBatteryTee" ><img id="RectifierToBatteryTeeImg" height=10 width=21></div><div id="BatteryTeeToInverter" class="upsBatteryTeeToInverter" ><img id="BatteryTeeToInverterImg" height=10 width=21></div><div id="BatteryTeeToBatteryMeter" class="upsBatteryTeeToBatteryMeter" ><img id="BatteryTeeToBatteryMeterImg" height=35 width=10></div><div id="BatteryMeterToBattery" class="upsBatteryMeterToBattery" ><img id="BatteryMeterToBatteryImg" height=35 width=10></div><div id="UserSpecifiedDataArea" class="userSpecifiedDataArea">
|
239
|
+
<table border="1" width="180" height="340">
|
240
|
+
<tr><td><center><img src="../images/nfinity_symbol.gif"></center></td></tr><tr><td><table border="0" align=center cellspacing="0" cellpadding="0">
|
241
|
+
<tr>
|
242
|
+
<td class="prominentUserColumnStyle"> </td><td> </td><td class="prominentUserColumnStyle"><b>VA FRAME</b></td></tr></table></td></tr><tr><td><center><b>CONTROL MODULES</b></center><table border="0" align=center cellspacing="0" cellpadding="0">
|
243
|
+
<script>
|
244
|
+
showNfinityModuleRow(deviceInfo.ctrlModInstallCount,"INSTALLED",4);
|
245
|
+
showNfinityModuleRow(deviceInfo.ctrlModRedunCount,"REDUNDANT",4);
|
246
|
+
showNfinityModuleRow(deviceInfo.ctrlModWarnCount,"WARNINGS",4);
|
247
|
+
showNfinityModuleRow(deviceInfo.ctrlModFailCount,"FAILED",4);
|
248
|
+
</script>
|
249
|
+
</table></td></tr><tr><td><center><b>POWER MODULES</b></center><table border="0" align=center cellspacing="0" cellpadding="0">
|
250
|
+
<script>
|
251
|
+
showNfinityModuleRow(deviceInfo.pwrModInstallCount,"INSTALLED",4);
|
252
|
+
showNfinityModuleRow(deviceInfo.pwrModActiveCount,"ACTIVE",4);
|
253
|
+
showNfinityModuleRow(deviceInfo.pwrModRedunCount,"REDUNDANT",4);
|
254
|
+
showNfinityModuleRow(deviceInfo.pwrModWarnCount,"WARNINGS",4);
|
255
|
+
showNfinityModuleRow(deviceInfo.pwrModFailCount,"FAILED",4);
|
256
|
+
</script>
|
257
|
+
</table></td></tr><tr><td><center><b>BATTERY MODULES</b></center><table border="0" align=center cellspacing="0" cellpadding="0">
|
258
|
+
<script>
|
259
|
+
showNfinityModuleRow(deviceInfo.batModInstallCount,"INSTALLED",4);
|
260
|
+
showNfinityModuleRow(deviceInfo.batModActiveCount,"ACTIVE",4);
|
261
|
+
showNfinityModuleRow(deviceInfo.batModWarnCount,"WARNINGS",0);
|
262
|
+
showNfinityModuleRow(deviceInfo.batModFailCount,"FAILED",4);
|
263
|
+
</script>
|
264
|
+
</table></td></tr></table></div><script language="JavaScript" type="text/javascript">
|
265
|
+
showSegment(true, "InputTeeToRectifier");
|
266
|
+
showSegment(true, "RectifierToBatteryTee");
|
267
|
+
</script>
|
268
|
+
|
269
|
+
|
270
|
+
</body></html>
|
271
|
+
http_version:
|
272
|
+
recorded_at: Thu, 05 Dec 2013 17:23:32 GMT
|
273
|
+
recorded_with: VCR 2.8.0
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
|
8
|
+
require 'liebert'
|
9
|
+
require 'vcr'
|
10
|
+
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
|
11
|
+
|
12
|
+
RSpec.configure do |config|
|
13
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
14
|
+
config.run_all_when_everything_filtered = true
|
15
|
+
config.filter_run :focus
|
16
|
+
|
17
|
+
# Run specs in random order to surface order dependencies. If you find an
|
18
|
+
# order dependency and want to debug it, you can fix the order by providing
|
19
|
+
# the seed, which is printed after each run.
|
20
|
+
# --seed 1234
|
21
|
+
config.order = 'random'
|
22
|
+
end
|
23
|
+
|
data/spec/support/vcr.rb
ADDED
data/spec/ups_spec.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe UPS do
|
4
|
+
before :all do
|
5
|
+
VCR.use_cassette 'ups' do
|
6
|
+
@ups = UPS.new(ENV['LIEBERT_UPS_URI'])
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
it 'responds to input_amps' do
|
11
|
+
expect(@ups.input_amps).to eq "Input_amps\t16.5"
|
12
|
+
end
|
13
|
+
|
14
|
+
it 'responds to output_amps' do
|
15
|
+
expect(@ups.output_amps).to eq "Output_amps\t33.5"
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'responds to battery_voltage' do
|
19
|
+
expect(@ups.battery_voltage).to eq "Battery_voltage\t548.0"
|
20
|
+
end
|
21
|
+
|
22
|
+
it 'responds to charge' do
|
23
|
+
expect(@ups.charge).to eq "Charge\t100.0"
|
24
|
+
end
|
25
|
+
|
26
|
+
it 'responds to all' do
|
27
|
+
expect(@ups.all).to eq "Input_amps\t16.5\nOutput_amps\t33.5\nBattery_voltage\t548.0\nCharge\t100.0\n"
|
28
|
+
end
|
29
|
+
end
|
metadata
ADDED
@@ -0,0 +1,181 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: liebert
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brooks Swinnerton
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-12-05 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: pry
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ~>
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.15.0
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.15.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: vcr
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - '>='
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rest-client
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: nokogiri
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
description: A gem to gather metrics from Liebert products with a web interface
|
126
|
+
email:
|
127
|
+
- bswinnerton@gmail.com
|
128
|
+
executables:
|
129
|
+
- liebert
|
130
|
+
extensions: []
|
131
|
+
extra_rdoc_files: []
|
132
|
+
files:
|
133
|
+
- .gitignore
|
134
|
+
- Gemfile
|
135
|
+
- LICENSE.txt
|
136
|
+
- README.md
|
137
|
+
- Rakefile
|
138
|
+
- bin/liebert
|
139
|
+
- lib/liebert.rb
|
140
|
+
- lib/liebert/airconditioner.rb
|
141
|
+
- lib/liebert/scrapable.rb
|
142
|
+
- lib/liebert/ups.rb
|
143
|
+
- lib/liebert/version.rb
|
144
|
+
- liebert.gemspec
|
145
|
+
- spec/airconditioner_spec.rb
|
146
|
+
- spec/cassettes/airconditioner.yml
|
147
|
+
- spec/cassettes/ups.yml
|
148
|
+
- spec/spec_helper.rb
|
149
|
+
- spec/support/vcr.rb
|
150
|
+
- spec/ups_spec.rb
|
151
|
+
homepage: https://github.com/bswinnerton/liebert
|
152
|
+
licenses:
|
153
|
+
- MIT
|
154
|
+
metadata: {}
|
155
|
+
post_install_message:
|
156
|
+
rdoc_options: []
|
157
|
+
require_paths:
|
158
|
+
- lib
|
159
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - '>='
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
165
|
+
requirements:
|
166
|
+
- - '>='
|
167
|
+
- !ruby/object:Gem::Version
|
168
|
+
version: '0'
|
169
|
+
requirements: []
|
170
|
+
rubyforge_project:
|
171
|
+
rubygems_version: 2.1.3
|
172
|
+
signing_key:
|
173
|
+
specification_version: 4
|
174
|
+
summary: A gem to gather metrics from Liebert products with a web interface
|
175
|
+
test_files:
|
176
|
+
- spec/airconditioner_spec.rb
|
177
|
+
- spec/cassettes/airconditioner.yml
|
178
|
+
- spec/cassettes/ups.yml
|
179
|
+
- spec/spec_helper.rb
|
180
|
+
- spec/support/vcr.rb
|
181
|
+
- spec/ups_spec.rb
|