genesis_collector 0.1.39 → 0.1.40
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/genesis_collector/collector.rb +1 -1
- data/lib/genesis_collector/ipmi.rb +11 -7
- data/lib/genesis_collector/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d084e72924bc0a833ce5989ecae28f9df02c7830
|
4
|
+
data.tar.gz: 9ca1ba65742ee1eed751f897ebfc53ee7047de7f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86c46b8a7393642168b512564507dd5faee75970eddd57b1ed7dbf53e8d87dd153e76e56c1c422c49176ead47070becdea4905430f62e3b71407f1617637ee85
|
7
|
+
data.tar.gz: fe467b952c545511b34b32a1c8fe6fc9851ea8ccb01046e1c97d6b391df6c106bf70f464de9d402f120ad0bf8569d8ee94ac73255397cf48f39467be0fa93015
|
@@ -195,7 +195,7 @@ module GenesisCollector
|
|
195
195
|
end
|
196
196
|
|
197
197
|
def read_dmi(key)
|
198
|
-
value = shellout_with_timeout("dmidecode -s #{key}").gsub(/^#.+$/, '').strip
|
198
|
+
value = shellout_with_timeout("dmidecode -s #{key}").gsub(/^#.+$/, '').gsub(/^Invalid entry length.*$/,'').strip
|
199
199
|
value = '' if '0123456789' == value # sometimes the firmware is broken
|
200
200
|
value.empty? ? nil : value
|
201
201
|
end
|
@@ -3,23 +3,27 @@ module GenesisCollector
|
|
3
3
|
|
4
4
|
def collect_ipmi
|
5
5
|
@payload[:ipmi] = {
|
6
|
-
address:
|
7
|
-
netmask:
|
8
|
-
mac:
|
9
|
-
gateway:
|
6
|
+
address: read_ipmi_lan_attribute('IP Address'),
|
7
|
+
netmask: read_ipmi_lan_attribute('Subnet Mask'),
|
8
|
+
mac: read_ipmi_lan_attribute('MAC Address'),
|
9
|
+
gateway: read_ipmi_lan_attribute('Default Gateway IP')
|
10
10
|
}
|
11
11
|
end
|
12
12
|
|
13
13
|
private
|
14
14
|
|
15
|
-
def
|
15
|
+
def read_ipmi_lan_attribute(key)
|
16
16
|
@ipmi_lan_output ||= shellout_with_timeout('ipmitool lan print', 10)
|
17
|
-
@ipmi_lan_output.match(/#{key}\s*:\s*(\S+)$/)
|
17
|
+
match = @ipmi_lan_output.match(/#{key}\s*:\s*(\S+)$/)
|
18
|
+
raise "IPMI lan print output missing key: #{key}" if match.nil?
|
19
|
+
match[1]
|
18
20
|
end
|
19
21
|
|
20
22
|
def read_ipmi_fru(key)
|
21
23
|
@ipmi_fru_output ||= shellout_with_timeout('ipmitool fru')
|
22
|
-
@ipmi_fru_output.match(/#{key}\s*:\s*(\S+)$/)
|
24
|
+
match = @ipmi_fru_output.match(/#{key}\s*:\s*(\S+)$/)
|
25
|
+
raise "IPMI fru output missing key: #{key}" if match.nil?
|
26
|
+
match[1]
|
23
27
|
end
|
24
28
|
|
25
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: genesis_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Radcliffe
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|