X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/0acc96fee75ec4377a8bd2350420747bb88d6993..5b06782fb9ac3ba77b39f8c5f2a98590479885c2:/cookbooks/hardware/templates/default/ohai.rb.erb?ds=inline diff --git a/cookbooks/hardware/templates/default/ohai.rb.erb b/cookbooks/hardware/templates/default/ohai.rb.erb index 1c19a450f..074f5cbf6 100644 --- a/cookbooks/hardware/templates/default/ohai.rb.erb +++ b/cookbooks/hardware/templates/default/ohai.rb.erb @@ -148,7 +148,7 @@ Ohai.plugin(:Hardware) do find_direct_disks(disk) find_nvme_disks(disk) - find_hp_disks(disk) if File.exist?("/usr/sbin/hpssacli") + find_hp_disks(disk) if File.exist?("/usr/sbin/ssacli") find_megaraid_disks(disk) if File.exist?("/usr/sbin/megacli") find_mpt1_disks(disk) if File.exist?("/usr/sbin/lsiutil") find_mpt2_disks(disk) if File.exist?("/usr/sbin/sas2ircu") @@ -158,7 +158,7 @@ Ohai.plugin(:Hardware) do find_md_arrays(disk) disk[:disks].each do |disk| - if disk[:vendor] =~ /^CVPR/ && disk[:model] == "INTEL" + if disk[:vendor] =~ /^(BTWA|CVPR|PHDV)/ && disk[:model] == "INTEL" disk[:model] = disk[:serial_number] disk[:serial_number] = disk[:vendor] disk[:vendor] = "INTEL" @@ -286,7 +286,7 @@ Ohai.plugin(:Hardware) do array = nil disk = nil - IO.popen(%w(hpssacli controller all show config detail)).each do |line| + IO.popen(%w(ssacli controller all show config detail)).each do |line| if line =~ /^Smart Array (\S+) / controller = { :id => devices[:controllers].count, @@ -359,7 +359,7 @@ Ohai.plugin(:Hardware) do controller[:device] = File.basename(device).sub(/^cciss(\d+)$/, "/dev/cciss/c\\1d0") elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:3:0/*:3:0:0/scsi_generic/sg*").first controller[:device] = "/dev/#{File.basename(device)}" - elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:0/scsi_generic/sg*").first + elsif device = Dir.glob("/sys/bus/pci/devices/#{controller[:pci_slot]}/host*/target*:1:0/*:1:0:*/scsi_generic/sg*").first controller[:device] = "/dev/#{File.basename(device)}" end end @@ -440,8 +440,10 @@ Ohai.plugin(:Hardware) do elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/ Regexp.last_match(1).split(/,\s*/).each do |state| case state + when "Unconfigured(bad)" then disk[:status] = "unconfigured" when "Online" then disk[:status] = "online" when "Hotspare" then disk[:status] = "hotspare" + when "Failed" then disk[:status] = "failed" when "Spun Up" then disk[:spun_down] = false when "Spun down" then disk[:spun_down] = true end @@ -479,8 +481,10 @@ Ohai.plugin(:Hardware) do elsif disk && line =~ /^Firmware state:\s+(.*\S)\s*$/ Regexp.last_match(1).split(/,\s*/).each do |state| case state + when "Unconfigured(bad)" then disk[:status] = "unconfigured" when "Online" then disk[:status] = "online" when "Hotspare" then disk[:status] = "hotspare" + when "Failed" then disk[:status] = "failed" when "Spun Up" then disk[:state] = "spun_up" when "Spun down" then disk[:state] = "spun_down" end