lib/boris/profilers/unix/solaris.rb in boris-1.0.1 vs lib/boris/profilers/unix/solaris.rb in boris-1.0.2

- old
+ new

@@ -9,10 +9,12 @@ def self.matches_target?(connector) return true if connector.value_at('uname') =~ /sunos/i end + def get_file_systems; super; end + def get_hardware super detect_platform if !@platform detect_zone if !@zone @@ -132,10 +134,11 @@ @installed_services end def get_local_user_groups; super; end + def get_network_id; super; end def get_network_interfaces super detect_platform if !@platform @@ -165,12 +168,18 @@ # can't get macs from prtpicl) mac_mapping = @connector.values_at(%q{/usr/bin/netstat -pn | grep SP | nawk '{print $1 "|" $2 "|" toupper($5)}'}) # if this host is in a child zone, drop any interfaces that are not found in the ifconfig # command output (since these would likely be picked up when scanning the zone host) + hardware_details = nil + if @zone == :child found_ethernet_interfaces.delete_if{|fi| interface_configs.select{|config| config =~ /^#{fi[:driver]}#{fi[:instance]}/}.count == 0} + else + prtpicl_command = %q{/usr/sbin/prtpicl -c network -v | egrep ':model|:driver-name|:instance|:local-mac-address|:vendor-id|:device-id|\(network' | nawk '{if ($0 ~ /\(network/) print ""; else {first=$1; $1=""; print first "|" $0}}'} + prtpicl_command.gsub!(/network/, 'obp-device') if @platform == :x86 + hardware_details = @connector.values_at(prtpicl_command).join("\n").split(/\n\n/) end # now loop through each unique ethernet interface found on this host found_ethernet_interfaces.uniq.each do |fi| h = network_interface_template @@ -206,16 +215,10 @@ # run prtpicl command to grab hardware details if @zone == :child h[:model] = 'Virtual Ethernet Adapter' h[:vendor] = VENDOR_ORACLE else - prtpicl_command = %q{/usr/sbin/prtpicl -c network -v | egrep ':model|:driver-name|:instance|:local-mac-address|:vendor-id|:device-id|\(network' | nawk '{if ($0 ~ /\(network/) print ""; else {first=$1; $1=""; print first "|" $0}}'} - - prtpicl_command.gsub!(/network/, 'obp-device') if @platform == :x86 - - hardware_details = @connector.values_at(prtpicl_command).join("\n").split(/\n\n/) - hardware = hardware_details.grep(/driver-name\|.*#{fi[:driver]}/).grep(/instance\|.*#{fi[:instance]}/)[0].split(/\n/) h[:vendor_id] = hardware.grep(/vendor-id\|/)[0].after_pipe unless hardware.grep(/vendor-id\|/).empty? h[:model_id] = hardware.grep(/device-id\|/)[0].after_pipe unless hardware.grep(/device-id\|/).empty? @@ -289,16 +292,17 @@ end def get_operating_system super - install_log_date = @connector.value_at("ls -l /var/sadm/system/logs/install_log | nawk '{print $6" "$7" "$8'}") + install_log_date = @connector.value_at(%q{ls -l /var/sadm/system/logs/install_log | nawk '{print $6" "$7" "$8'}}) + @operating_system[:date_installed] = DateTime.parse(install_log_date) os_data = @connector.value_at('uname -rv').split @operating_system[:kernel] = os_data[1] @operating_system[:name] = 'Oracle Solaris' - @operating_system[:version] = os_data[0] + @operating_system[:version] = os_data[0].after_period @operating_system end private