[SNMP4J] snmp4j-smi-pro issue
Frank Fock
fock at agentpp.com
Thu Nov 3 22:32:49 CET 2016
Hi Ronald,
Most likely, you get the IMPORTS from a different MIB module, or the MIB
module
could not be parsed correctly (this could happen if you use the lenient mode
with a broken MIB module).
Hope this helps.
Best regards,
Frank
Am 03.11.2016 um 17:27 schrieb Ronald Braswell:
> 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
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j
--
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax: +49 7024 8688231
More information about the SNMP4J
mailing list