Class: Copian::Collector::Cisco
- Defined in:
- lib/copian/collector/cisco.rb
Instance Method Summary collapse
-
#addresses ⇒ Object
:yields: mac_address, ip_addresses_array.
-
#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
#addresses ⇒ Object
:yields: mac_address, ip_addresses_array
15 16 17 18 19 |
# File 'lib/copian/collector/cisco.rb', line 15 def addresses # :yields: mac_address, ip_addresses_array addresses_collector.collect do |mac, ips| yield mac, ips end end |
#ports ⇒ Object
:yields: ifindex, ifname, addresses_array
20 21 22 23 24 25 26 |
# File 'lib/copian/collector/cisco.rb', line 20 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
8 9 10 11 12 13 14 |
# File 'lib/copian/collector/cisco.rb', line 8 def vlans # :yields: id, ifindex, name load_ifnames vlans_collector.collect do |vlan_id, vlan_index| yield vlan_id, vlan_index, @ifnames[vlan_index] end end |