Class: Copian::Collector::HpVlansCollector

Inherits:
AbstractCollector show all
Defined in:
lib/copian/collector/hp/vlans.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
# File 'lib/copian/collector/hp/vlans.rb', line 4

def collect
  oid = SNMP::ObjectID.new('1.3.6.1.2.1.2.2.1.3')
  @manager.walk(oid) do |r|
    r.each do |varbind|
      next unless varbind.value.to_i == 53  # propVirtual type
      vlan_index = varbind.name.index(oid).to_s.to_i
      # Not sure how to get this vlan ID, ifName sort of has it

      yield nil, vlan_index
    end
  end
end