You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am trying to load a mib file and try parsing it and print the type of the node using SmiNode.Type field. But every time the type is <nil> when trying to print it. Note: The SmiNode is not nil but SmiNode.Type is <nil> here. I am not getting the issue here. Is something to do with the way I am loading the mib files or it is to do with the mib itself?
I am trying to load the modules as below:
func initGosmi() {
MibFilesPath := "C:\\Users\\sn\\Downloads\\mibs"
Modules := "COMMON-DEFINITION,ALARM-IRP,SNMPv2-CONF,SNMPv2-SMI,SNMPv2-TC"
var mibFiles []string = strings.Split(MibFilesPath, ",")
var modules []string = strings.Split(Modules, ",")
gosmi.Init()
for _, path := range mibFiles {
gosmi.AppendPath(path)
}
for _, module := range modules {
_, err := gosmi.LoadModule(module)
if err != nil {
fmt.Printf("Init Error: %s\n", err)
}
}
}
Below is the definition of the node from the mib file:
From ALARM-IRP.mib file
nAlarmEntry OBJECT-TYPE
SYNTAX NAlarmEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"One entry in the alarm table holds one active alarm."
INDEX { nAlarmId }
::= { nAlarmTable 1 }
NAlarmEntry ::= SEQUENCE {
nAlarmId NAlarmId,
nAlarmText NAlarmText
}
nAlarmText OBJECT-TYPE
SYNTAX NAlarmText
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"This object represents the alarm text and contains
basic information on the fault"
::= { nAlarmEntry 5 }
From COMMON-DEFINITION.mib file
NAlarmText ::= TEXTUAL-CONVENTION
DISPLAY-HINT "3072t"
STATUS current
DESCRIPTION
"Alarm text contains information on the fault situation
in the NE in human readable format"
SYNTAX OCTET STRING (SIZE (0..3072))
The text was updated successfully, but these errors were encountered:
Hi, I am trying to load a mib file and try parsing it and print the type of the node using
SmiNode.Type
field. But every time the type is<nil>
when trying to print it. Note: The SmiNode is not nil butSmiNode.Type
is<nil>
here. I am not getting the issue here. Is something to do with the way I am loading the mib files or it is to do with the mib itself?I am trying to load the modules as below:
Below is the definition of the node from the mib file:
The text was updated successfully, but these errors were encountered: