idrac 0.5.0 → 0.5.1
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.
- checksums.yaml +4 -4
- data/bin/idrac +24 -24
- data/lib/idrac/system.rb +5 -5
- data/lib/idrac/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75d31422362fd2d548fff6e03265162bdf4cfb34237085a7e9e14170bcd8d5eb
|
4
|
+
data.tar.gz: 219ca3faaaf4e3b8d85ceb0db0baebe5ffa81c2e5afc61ba13851c76fd1f6b41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b37b6e6094ee872b2989dcd4d66a8a965502ed7193a66813d5ed3ff60592cfae47c26f9caf9b2f0c34580d366845b49414f55bd909519618d8439cdb71fe8473
|
7
|
+
data.tar.gz: 30ffb9cbd571489a12f71c553777089541c3550287aca5a267bc4b964da41ff268219ca9e4306097c0aced7ae29a1bd7d17f6ccccfefd45f77778a29891801e1
|
data/bin/idrac
CHANGED
@@ -906,13 +906,13 @@ module IDRAC
|
|
906
906
|
puts "\nProcessor Summary:".green.bold
|
907
907
|
puts "=" * 50
|
908
908
|
|
909
|
-
health_color = cpus
|
909
|
+
health_color = cpus.status == "OK" ? :green : :red
|
910
910
|
|
911
|
-
puts "Processor Model:".ljust(25) + cpus
|
912
|
-
puts "Processor Count:".ljust(25) + cpus
|
913
|
-
puts "Physical Cores:".ljust(25) + cpus
|
914
|
-
puts "Logical Cores:".ljust(25) + cpus
|
915
|
-
puts "Status:".ljust(25) + cpus
|
911
|
+
puts "Processor Model:".ljust(25) + cpus.model.to_s.light_cyan
|
912
|
+
puts "Processor Count:".ljust(25) + cpus.count.to_s.light_cyan
|
913
|
+
puts "Physical Cores:".ljust(25) + cpus.cores.to_s.light_cyan
|
914
|
+
puts "Logical Cores:".ljust(25) + cpus.threads.to_s.light_cyan
|
915
|
+
puts "Status:".ljust(25) + cpus.status.to_s.send(health_color)
|
916
916
|
|
917
917
|
puts "=" * 50
|
918
918
|
end
|
@@ -1164,16 +1164,16 @@ module IDRAC
|
|
1164
1164
|
with_idrac_client do |client|
|
1165
1165
|
info = client.system_info
|
1166
1166
|
|
1167
|
-
if info
|
1167
|
+
if info.is_dell
|
1168
1168
|
puts "Dell iDRAC System:".green.bold
|
1169
|
-
puts " Service Tag: #{info
|
1170
|
-
puts " Model: #{info
|
1171
|
-
puts " iDRAC Version: #{info
|
1172
|
-
puts " Firmware Version: #{info
|
1169
|
+
puts " Service Tag: #{info.service_tag}".cyan
|
1170
|
+
puts " Model: #{info.model}".cyan
|
1171
|
+
puts " iDRAC Version: #{info.idrac_version}".cyan
|
1172
|
+
puts " Firmware Version: #{info.firmware_version}".cyan
|
1173
1173
|
else
|
1174
1174
|
puts "Not a Dell iDRAC system".yellow
|
1175
|
-
puts " Product: #{info
|
1176
|
-
if info
|
1175
|
+
puts " Product: #{info.product}".cyan
|
1176
|
+
if info.is_ancient_dell
|
1177
1177
|
puts " Ancient Dell System detected. Update firmware.".yellow
|
1178
1178
|
end
|
1179
1179
|
end
|
@@ -1204,17 +1204,17 @@ module IDRAC
|
|
1204
1204
|
puts "=" * 50
|
1205
1205
|
|
1206
1206
|
# Display overall health with color coding
|
1207
|
-
overall_color = health
|
1208
|
-
system_color = health
|
1209
|
-
processor_color = health
|
1210
|
-
memory_color = health
|
1211
|
-
storage_color = health
|
1212
|
-
|
1213
|
-
puts "Overall Health:".ljust(25) + health
|
1214
|
-
puts "System Health:".ljust(25) + health
|
1215
|
-
puts "Processor Health:".ljust(25) + health
|
1216
|
-
puts "Memory Health:".ljust(25) + health
|
1217
|
-
puts "Storage Health:".ljust(25) + (health
|
1207
|
+
overall_color = health.overall == "OK" ? :green : :red
|
1208
|
+
system_color = health.system == "OK" ? :green : :red
|
1209
|
+
processor_color = health.processor == "OK" ? :green : :red
|
1210
|
+
memory_color = health.memory == "OK" ? :green : :red
|
1211
|
+
storage_color = health.storage == "OK" ? :green : (health.storage.nil? ? :yellow : :red)
|
1212
|
+
|
1213
|
+
puts "Overall Health:".ljust(25) + health.overall.to_s.send(overall_color)
|
1214
|
+
puts "System Health:".ljust(25) + health.system.to_s.send(system_color)
|
1215
|
+
puts "Processor Health:".ljust(25) + health.processor.to_s.send(processor_color)
|
1216
|
+
puts "Memory Health:".ljust(25) + health.memory.to_s.send(memory_color)
|
1217
|
+
puts "Storage Health:".ljust(25) + (health.storage || "Unknown").to_s.send(storage_color)
|
1218
1218
|
|
1219
1219
|
puts "=" * 50
|
1220
1220
|
end
|
data/lib/idrac/system.rb
CHANGED
@@ -368,16 +368,16 @@ module IDRAC
|
|
368
368
|
info[:model] = system_data["Model"]
|
369
369
|
end
|
370
370
|
|
371
|
-
return info
|
371
|
+
return RecursiveOpenStruct.new(info, recurse_over_arrays: true)
|
372
372
|
else
|
373
373
|
# Try to handle ancient Dell models where Product is null or non-standard
|
374
374
|
if data["Product"].nil? || data.dig("Oem", "Dell")
|
375
375
|
info[:is_ancient_dell] = true
|
376
|
-
return info
|
376
|
+
return RecursiveOpenStruct.new(info, recurse_over_arrays: true)
|
377
377
|
end
|
378
378
|
end
|
379
379
|
|
380
|
-
return info
|
380
|
+
return RecursiveOpenStruct.new(info, recurse_over_arrays: true)
|
381
381
|
rescue JSON::ParserError
|
382
382
|
raise Error, "Failed to parse system information: #{response.body}"
|
383
383
|
end
|
@@ -402,7 +402,7 @@ module IDRAC
|
|
402
402
|
status: data.dig("ProcessorSummary", "Status", "Health")
|
403
403
|
}
|
404
404
|
|
405
|
-
return summary
|
405
|
+
return RecursiveOpenStruct.new(summary, recurse_over_arrays: true)
|
406
406
|
rescue JSON::ParserError
|
407
407
|
raise Error, "Failed to parse processor information: #{response.body}"
|
408
408
|
end
|
@@ -427,7 +427,7 @@ module IDRAC
|
|
427
427
|
storage: data.dig("Storage", "Status", "Health")
|
428
428
|
}
|
429
429
|
|
430
|
-
return health
|
430
|
+
return RecursiveOpenStruct.new(health, recurse_over_arrays: true)
|
431
431
|
rescue JSON::ParserError
|
432
432
|
raise Error, "Failed to parse system health information: #{response.body}"
|
433
433
|
end
|
data/lib/idrac/version.rb
CHANGED