- 论坛徽章:
- 0
|
本帖最后由 yqhzh 于 2015-04-14 16:46 编辑
技术不够,玩了一个小时,只能对正则分开处理得到数据。所以特请教大家,谢谢先。
数据如下:
--
-- The Alarm Status History
--
alarmStatusHistory OBJECT IDENTIFIER ::= { msMIBObjects 8 }
alarmStatusHistoryPurge OBJECT-TYPE
SYNTAX Integer32 (1..1000)
MAX-ACCESS read-write
STATUS obsolete
DESCRIPTION
"Obsolete: This object is used to purge entries in the
alarmStatusHistoryTable. The value of this
object determines the number of entries that
are purged."
DEFVAL { 1 }
::= { alarmStatusHistory 1 }
AlarmStatusHistoryEntry ::= SEQUENCE {
ashAlarmIndex Integer32,
ashAlarmSeverity AlarmSeverity,
ashAlarmName DisplayString,
ashCardType CardType,
ashSlot Integer32,
ashActivationTime DateAndTime,
ashDeactivationTime DateAndTime
}
asPassword OBJECT-TYPE
SYNTAX DisplayString(SIZE(0.. 128 ))
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The server password."
DEFVAL { ''H }
::= { audioSegmentTable 8 }
XnfsSlotEntry ::=
SEQUENCE {
xnfsSlotID Integer32,
xnfsSlotIntf Integer32,
xnfsSlotIpAddress IpAddress,
xnfsSlotHealthChkInterval Unsigned32,
xnfsSlotUnavailAttempts Unsigned32,
xnfsEnable CONVTruthValue,
xnfsCache CONVTruthValue
}
要求是:
1,过滤得到含有 "OBJECT IDENTIFIER ::= { msMIBObjects" 行的 第一个字段。例如: alarmStatusHistory
2,过滤得到含有 "Entry ::= SEQUENCE {"
或者 "Entry ::=
SEQUENCE {" 的条目。注意有的情况下"Entry"和“SEQUENCE"是在同一行,有的情况下是在 相邻行。
"Entry ::= SEQUENCE" 这个条目中{} 之间的行数未知。
3,其余的数据去掉即可,各条目或者行的顺序需要和原始数据一致。
期望结果如下:
alarmStatusHistory OBJECT IDENTIFIER ::= { msMIBObjects 8 }
AlarmStatusHistoryEntry ::= SEQUENCE {
ashAlarmIndex Integer32,
ashAlarmSeverity AlarmSeverity,
ashAlarmName DisplayString,
ashCardType CardType,
ashSlot Integer32,
ashActivationTime DateAndTime,
ashDeactivationTime DateAndTime
}
XnfsSlotEntry ::=
SEQUENCE {
xnfsSlotID Integer32,
xnfsSlotIntf Integer32,
xnfsSlotIpAddress IpAddress,
xnfsSlotHealthChkInterval Unsigned32,
xnfsSlotUnavailAttempts Unsigned32,
xnfsEnable CONVTruthValue,
xnfsCache CONVTruthValue
}
|
|