Class: Copian::Collector::Hp
- Defined in:
- lib/copian/collector/hp.rb
Instance Method Summary collapse
-
#ports ⇒ Object
:yields: ifindex, ifname, addresses_array.
-
#vlans ⇒ Object
:yields: id, ifindex, name.
Methods inherited from Generic
#bandwidth, #descriptions, #initialize, #inspect, #port_stats
Constructor Details
This class inherits a constructor from Copian::Collector::Generic
Instance Method Details
#ports ⇒ Object
:yields: ifindex, ifname, addresses_array
16 17 18 19 20 21 22 |
# File 'lib/copian/collector/hp.rb', line 16 def ports # :yields: ifindex, ifname, addresses_array load_ifnames ports_collector.collect do |port_ifindex, port_addresses| yield port_ifindex, @ifnames[port_ifindex], port_addresses end end |
#vlans ⇒ Object
:yields: id, ifindex, name
7 8 9 10 11 12 13 14 15 |
# File 'lib/copian/collector/hp.rb', line 7 def vlans # :yields: id, ifindex, name load_ifnames vlans_collector.collect do |vlan_id, vlan_index| vlan_name = @ifnames[vlan_index] vlan_id = vlan_name.gsub(/[^0-9]/, '').to_i yield vlan_id, vlan_index, vlan_name end end |