class Apscanner::Sensor

Attributes

access_points[R]
community[R]
ip_address[R]
port[R]
type[RW]
uuid[R]

Public Class Methods

new(options = {}) click to toggle source
# File lib/apscanner/entities/sensor.rb, line 6
def initialize(options = {})
  @port = options[:port]
  @ip_address = options[:ip_address]
  @community = options[:community]
  @uuid = options[:uuid]
  @type = options[:type].to_sym
  @access_points = []
end

Public Instance Methods

scan() click to toggle source
# File lib/apscanner/entities/sensor.rb, line 15
def scan
  t0 = Time.now
  @access_points = SnmpManager.new(self).run
  Apscanner.logger.info("Scanned #{@access_points.count} APs from " \
                        "#{@ip_address} in #{(Time.now - t0).round(2)}s.")
  self
end