我在 PySMI 中将 min 文件解析为 json 文件时遇到了问题。
我打开调试模式。问题发生在671线
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{"."}
在MIB文件中
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
}
MIB 文件或 PySMI 有什么问题?
MIB 文件或 PySMI 有什么问题?
正确的文档应该是这样的,
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
}
这就是 PySMI 抱怨外壳的原因。