parse my MIB file met type LOWE RCASE_IDENTIFIER error in pySmi

23 Views Asked by At

I met a problem in PySMI when parse a min file to a json file.

I turn on the debug mode. The issue is occur in 671 Line

2023-05-17 23:05:47,064 pysmi: failing on error Bad grammar near token type LOWE
RCASE_IDENTIFIER, value lldpinfo at MIB HH3C-SERVER-AGENT-MIB, line 671 from Fil
eReader{"."}                                                                  

In the MIB file


    hh3cNetWorkLldpInfoTable    OBJECT-TYPE
        SYNTAX      SEQUENCE  OF  hh3cNetWorkLldpInfoEntry
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION "The network LLDP information table."
        ::=  { hh3cNetwork  2 }

    hh3cNetWorkLldpInfoEntry    OBJECT-TYPE
        SYNTAX      hh3cNetWorkLldpInfoEntry
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION "Row Description"
        INDEX       {  hh3cLldpInfoIndex  }
        ::=  { hh3cNetWorkLldpInfoTable 1 }

    hh3cNetWorkLldpInfoEntry  ::=  SEQUENCE {
        hh3cLldpInfoIndex  Integer,
        hh3cLldpInterfaceName  DisplayString,
        hh3cLldpInfoChassisMac  DisplayString,
        hh3cLldpInfoChassisName  DisplayString,
        hh3cLldpInfoPortName  DisplayString,
        hh3cLldpInfoPortDescr  DisplayString,
        hh3cLldpInfoVlanID  Integer
        }

What's wrong in MIB file or PySMI?

What's wrong in MIB file or PySMI?

1

There are 1 best solutions below

0
Lex Li On

The correct doc should look like,


    hh3cNetWorkLldpInfoTable    OBJECT-TYPE
        SYNTAX      SEQUENCE  OF  Hh3cNetWorkLldpInfoEntry
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION "The network LLDP information table."
        ::=  { hh3cNetwork  2 }

    hh3cNetWorkLldpInfoEntry    OBJECT-TYPE
        SYNTAX      Hh3cNetWorkLldpInfoEntry
        MAX-ACCESS  not-accessible
        STATUS      current
        DESCRIPTION "Row Description"
        INDEX       {  hh3cLldpInfoIndex  }
        ::=  { hh3cNetWorkLldpInfoTable 1 }

    Hh3cNetWorkLldpInfoEntry  ::=  SEQUENCE {
        hh3cLldpInfoIndex  Integer,
        hh3cLldpInterfaceName  DisplayString,
        hh3cLldpInfoChassisMac  DisplayString,
        hh3cLldpInfoChassisName  DisplayString,
        hh3cLldpInfoPortName  DisplayString,
        hh3cLldpInfoPortDescr  DisplayString,
        hh3cLldpInfoVlanID  Integer
        }

That's why PySMI complained about the casing.