Class: Wifidiag::Adapters::CiscoWlc
- Inherits:
-
Object
- Object
- Wifidiag::Adapters::CiscoWlc
- Defined in:
- lib/wifidiag/adapters/cisco_wlc.rb
Instance Method Summary collapse
- #collect ⇒ Object
-
#initialize(host:, port: 161, community:) ⇒ CiscoWlc
constructor
A new instance of CiscoWlc.
- #wlc ⇒ Object
Constructor Details
#initialize(host:, port: 161, community:) ⇒ CiscoWlc
Returns a new instance of CiscoWlc.
11 12 13 14 15 |
# File 'lib/wifidiag/adapters/cisco_wlc.rb', line 11 def initialize(host:, port: 161, community:) @host = host @port = port @community = community end |
Instance Method Details
#collect ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/wifidiag/adapters/cisco_wlc.rb', line 17 def collect aps = {} wlc.clients.map do |client| if client.ap ap = aps.fetch(client.ap_mac) do aps[client.ap_mac] = ApData.new( name: client.ap.name, mac_address: client.ap.mac_address, location: client.ap.location, model: client.ap.model, ) end end ClientData.new( mac_address: client.mac_address, ip_address: client.ip_address, ap: ap, wlan_profile: client.wlan_profile, protocol: client.protocol, ap_mac: client.ap_mac, uptime: client.uptime, current_rate: client.current_rate, supported_data_rates: client.supported_data_rates, user: client.user, ssid: client.ssid, ) end end |
#wlc ⇒ Object
46 47 48 |
# File 'lib/wifidiag/adapters/cisco_wlc.rb', line 46 def wlc @snmp ||= WlcSnmp::Client.new(host: @host, port: @port, community: @community) end |