Class | SNMP::MIB |
In: |
lib/snmp/mib.rb
|
Parent: | Object |
MODULE_EXT | = | 'yaml' |
Import an SMIv2 MIB file for later loading. A module only needs to be installed once.
module_file - the filename of the module to be imported mib_dir - the output directory for the serialized MIB data
NOTE: This implementation requires that the ‘smidump’ tool is available in the PATH. This tool can be obtained from the libsmi website at http://www.ibr.cs.tu-bs.de/projects/libsmi/ .
ALSO NOTE: The file format in future releases is subject to change. For now, it is a simple YAML hash with the MIB symbol as the key and the OID as the value. These files could be generated manually if ‘smidump’ is not available.
Here is an example of the contents of an output file:
--- ipDefaultTTL: 1.3.6.1.2.1.4.2 ipForwDatagrams: 1.3.6.1.2.1.4.6 ipOutRequests: 1.3.6.1.2.1.4.10 ipOutNoRoutes: 1.3.6.1.2.1.4.12 ipReasmTimeout: 1.3.6.1.2.1.4.13 icmpInDestUnreachs: 1.3.6.1.2.1.5.3
The MIB.import_module method is only supported if the external ‘smidump’ tool is available. This method returns true if a known version of the tool is available.
Loads a module into this MIB. The module must be imported before it can be loaded. See MIB.import_module .
Returns the symbolic name of the given OID.
e.g. OID "1.3.6.1.2.1.1.0" returns symbol "SNMPv2-MIB::system.0"
Returns a VarBindList for the provided list of objects. If a string is provided it is interpretted as a symbolic OID.
This method accepts many different kinds of objects: