lib/wlc_snmp/client.rb in wlc_snmp-0.1.0 vs lib/wlc_snmp/client.rb in wlc_snmp-0.1.1
- old
+ new
@@ -83,10 +83,14 @@
data_rate: MIB_LWAPP_CLIENT_CURRENT_RATE,
supported_data_rates: MIB_LWAPP_CLIENT_RATE_SET,
user: MIB_LWAPP_CLIENT_USER,
ssid: MIB_LWAPP_CLIENT_SSID,
).map do |data|
- ip = data[:ip].to_s.unpack("C*").map(&:to_s).join(?.)
+ if data[:ip].is_a?(SNMP::IpAddress)
+ ip = data[:ip].to_s
+ else
+ ip = data[:ip].to_s.unpack("C*").map(&:to_s).join(?.)
+ end
mac = airespace_clients[ip] ? airespace_clients[ip] : nil
ap_mac = unpack_mac(data[:ap_mac])
ClientData.new(
mac_address: mac,