Module: ManageIQ::NetworkDiscovery

Defined in:
lib/manageiq/network_discovery.rb,
lib/manageiq/network_discovery/version.rb,
lib/manageiq/network_discovery/port_scanner.rb,
lib/manageiq/network_discovery/discover_probe.rb,
lib/manageiq/network_discovery/modules/IpmiProbe.rb,
lib/manageiq/network_discovery/modules/MSScvmmProbe.rb,
lib/manageiq/network_discovery/modules/WindowsProbe.rb,
lib/manageiq/network_discovery/modules/RedHatRhevmProbe.rb,
lib/manageiq/network_discovery/modules/VMwareEsxVcProbe.rb,
lib/manageiq/network_discovery/modules/VMwareServerProbe.rb,
lib/manageiq/network_discovery/modules/MSVirtualServerProbe.rb

Defined Under Namespace

Modules: DiscoverProbe Classes: IpmiProbe, MSScvmmProbe, MSVirtualServerProbe, PortScanner, RedHatRhevmProbe, VMwareEsxVcProbe, VMwareServerProbe, WindowsProbe

Constant Summary collapse

VERSION =
"0.1.2"

Class Method Summary collapse

Class Method Details

.scanHost(sInfo) ⇒ Object

Probing with Traceroute

1. temporarySet = random addresses in domain that end in ".1"
2. initialize cumulativeAnds and cumulativeOrs hashtables to null
3. foreach node in temporarySet do
  a. ping(this_node)
  b. if (this_node is alive) then add this_node to permanentSet else continue
  c. use Heuristic3 to add more addresses to temporarySet
  d. traceroute(node)
  e. this_router = penultimate hop in traceroute
  f. find all IP addresses of this_router with a DNS lookup
  g. this_gateway = address such that number of '1' bits in IP(this_router) XOR this_node is minimized
  h. oldSubnet = cumulativeAnds[this_gateway]
  i. cumulativeAnds[this_gateway] = this_node AND cumulativeAnds[this_gateway]
  j. cumulativeOrs[this_gateway] = this_node OR cumulativeOrs[this_gateway]
  k. newSubnet = cumulativeAnds[this_gateway]
  l. newSubnetMask = NOT (cumulativeAnds[this_gateway] XOR cumulativeOrs[this_gateway])
  m. store node in newSubnet
  n. if necessary, move hosts in permanent set's oldSubnet to newSubnet


73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/manageiq/network_discovery.rb', line 73

def self.scanHost(sInfo)
  require 'net/ping'
  sInfo.os = []
  sInfo.hypervisor = []

  # If the usePing flag is set we try to ping the box first
  # and skip scanning if the ping fails.
  pingOk = true
  begin
      pingOk = Net::Ping::External.new(sInfo.ipaddr).ping if sInfo.usePing
    rescue Timeout::Error
      pingOk = false
    end
  DiscoverProbe.getProductMod(sInfo) if pingOk
end