X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/a9f84d3b2526857bb3eb067ac94aea53c1954f4d..c784b570ae5193b222866d410ddd24b90547bed7:/cookbooks/hardware/templates/default/ohai.rb.erb diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 536377de4..1ca3089b7 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -155,7 +155,7 @@ Ohai.plugin(:Hardware) do find_adaptec_disks(disk) if File.exist?("/usr/sbin/arcconf") find_areca_disks(disk) if File.exist?("/opt/areca/x86_64/cli64") - find_md_arrays(disk) + find_md_arrays(disk) if File.exist?("/prod/mdstat") disk[:disks].each do |disk| if disk[:vendor] =~ /^(BTWA|CVPR|PHDV)/ && disk[:model] == "INTEL" @@ -331,6 +331,7 @@ Ohai.plugin(:Hardware) do when "Hardware Revision" then controller[:hardware_version] = Regexp.last_match(2) when "Firmware Version" then controller[:firmware_version] = Regexp.last_match(2) when "PCI Address (Domain:Bus:Device.Function)" then controller[:pci_slot] = Regexp.last_match(2) + when "Battery/Capacitor Status" then controller[:battery_status] = Regexp.last_match(2).split.first.downcase end elsif controller && line =~ /^ Logical Drive: (\d+)$/ array = { @@ -403,9 +404,11 @@ Ohai.plugin(:Hardware) do end devices[:disks].each do |disk| - if location = disks.find_index(disk[:location]) - disk[:smart_device] = "cciss,#{location}" - end + controller = disk[:controller] + + next unless devices[:controllers][controller][:type] == "hp" + + disk[:smart_device] = "cciss,#{disks.find_index(disk[:location])}" if disk[:status] == "Failed" disk[:status] = "failed"