Class: SNMP4JR::MibManager

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/snmp4jr/mib_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeMibManager

Returns a new instance of MibManager.



13
14
15
16
17
18
# File 'lib/snmp4jr/mib_manager.rb', line 13

def initialize
  @compilation_monitor = nil
  @load_into_repository = true
  @update_existent = true
  @compile_leniently = false
end

Instance Attribute Details

#compilation_monitorObject (readonly)

Returns the value of attribute compilation_monitor.



10
11
12
# File 'lib/snmp4jr/mib_manager.rb', line 10

def compilation_monitor
  @compilation_monitor
end

#compile_lenientlyObject (readonly)

Returns the value of attribute compile_leniently.



10
11
12
# File 'lib/snmp4jr/mib_manager.rb', line 10

def compile_leniently
  @compile_leniently
end

#license_keyObject

Returns the value of attribute license_key.



8
9
10
# File 'lib/snmp4jr/mib_manager.rb', line 8

def license_key
  @license_key
end

#load_into_repositoryObject (readonly)

Returns the value of attribute load_into_repository.



10
11
12
# File 'lib/snmp4jr/mib_manager.rb', line 10

def load_into_repository
  @load_into_repository
end

#mib_directoryObject

Returns the value of attribute mib_directory.



8
9
10
# File 'lib/snmp4jr/mib_manager.rb', line 8

def mib_directory
  @mib_directory
end

#update_existentObject (readonly)

Returns the value of attribute update_existent.



10
11
12
# File 'lib/snmp4jr/mib_manager.rb', line 10

def update_existent
  @update_existent
end

Instance Method Details

#find_smi_object(oid) ⇒ Object



32
33
34
35
# File 'lib/snmp4jr/mib_manager.rb', line 32

def find_smi_object(oid)
  return nil unless loaded?
  manager.find_smi_object(SNMP4JR::SMI::OID.new(oid))
end

#loadObject



20
21
22
23
24
25
# File 'lib/snmp4jr/mib_manager.rb', line 20

def load
  return if loaded? || license_key.nil? || mib_directory.nil?
  compile_mibs
  set_formats
  @loaded = true
end

#loaded?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/snmp4jr/mib_manager.rb', line 27

def loaded?
  @loaded == true
end