[SNMP4J] snmp4j-smi-pro issue

Ronald Braswell rpbraswell at gmail.com
Thu Nov 3 17:27:13 CET 2016


I am trying to use the SmiModule::getImports() to get the imports for a
module.

Then I want to use the SmiImport::getImportedObjectNames() and
SmiImport::getSourceModuleName()
methods for each import.

Here is the import clause for XUPS-MIB:

IMPORTS
    TimeTicks, Gauge32, Counter32, Integer32
        FROM SNMPv2-SMI
    DisplayString
        FROM SNMPv2-TC
    MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE
        FROM SNMPv2-SMI
    MODULE-COMPLIANCE, OBJECT-GROUP, NOTIFICATION-GROUP
        FROM SNMPv2-CONF
    eaton, xupsEnvironment
        FROM EATON-OIDS
    -- Need to import these EMP objects to support PowerMIB-style traps for
EMP
    xupsContactIndex, xupsContactType, xupsContactState, xupsContactDescr,
    xupsEnvRemoteTemp, xupsEnvRemoteTempLowerLimit,
xupsEnvRemoteTempUpperLimit,
    xupsEnvRemoteHumidity, xupsEnvRemoteHumidityLowerLimit,
    xupsEnvRemoteHumidityUpperLimit
        FROM EATON-EMP-MIB;

Issues:

   The source module names I get from this module are:

   RFC1155-SMI
   RFC1213-MIB
   RFC-1212
   RFC-1215

   List <SmiImport> moduleImports = smiModule.getImports();
   List <String> importedModules = moduleImports.stream().map( i ->
i.getSourceModuleName() ).collect(Collectors.toList());
   importedModules.stream().forEach(System.out::println);

Am I doing something wrong?

Yet, smiModule.getObjectNames() does include the objects imported from the
EATON-EMP-OID (e.g.  xupsEnvRemoteTemp) but the imported objects do not
have all fields populated (e.g. units) whereas the EATON-EMP-MIB objects do
have all fields populated (according to the MIB.

Why would I not see EATON-EMP-MIB in the list of SmiImport for the XUPS-MIB
module?

Ron



More information about the SNMP4J mailing list