Class: Apscanner::SnmpManager

Inherits:
Object
  • Object
show all
Defined in:
lib/apscanner/entities/snmp_manager.rb

Constant Summary collapse

SNMP_OID =
{
  wlc: {
    name: '1.3.6.1.4.1.9.9.513.1.1.1.1.5',
    mac: '1.3.6.1.4.1.9.9.513.1.2.3.1.1',
    clients: '1.3.6.1.4.1.9.9.513.1.1.1.1.54'
  },
  meraki: {
    system: '1.3.6.1.4.1.29671.1.1.4.1',
    mac: '1.3.6.1.4.1.29671.1.1.4.1.1',
    name: '1.3.6.1.4.1.29671.1.1.4.1.2',
    status: '1.3.6.1.4.1.29671.1.1.4.1.3',
    clients: '1.3.6.1.4.1.29671.1.1.4.1.5'
  }
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(sensor) ⇒ SnmpManager

Returns a new instance of SnmpManager.



18
19
20
# File 'lib/apscanner/entities/snmp_manager.rb', line 18

def initialize(sensor)
  @sensor = sensor
end

Instance Method Details

#runObject



22
23
24
25
26
# File 'lib/apscanner/entities/snmp_manager.rb', line 22

def run
  response = request_by_type
  return [] if empty?(response)
  SnmpParser.new(response, @sensor.type).run
end