Class: Copian::Collector::DellPortsCollector

Inherits:
PortsCollector show all
Defined in:
lib/copian/collector/dell/ports.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from AbstractCollector

#initialize

Constructor Details

This class inherits a constructor from Copian::Collector::AbstractCollector

Instance Method Details

#collectObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/copian/collector/dell/ports.rb', line 4

def collect
  oid = SNMP::ObjectId.new('1.3.6.1.2.1.17.7.1.2.2.1.2')
  results = Hash.new

  manager.walk(oid) do |r|
    r.each do |varbind|
      results[varbind.value.to_i] ||= Array.new
      results[varbind.value.to_i] << suboid_to_mac(varbind.name.index(oid))
    end
  end

  results.each do |if_index, addresses|
    yield if_index, addresses
  end
end