Download Simple Network Management Protocol (SNMP)
Transcript
1.8 Agent Implementation Example
fName
DisplayString,
fAddress
DisplayString,
fStatus
RowStatus
}
fIndex OBJECT-TYPE
SYNTAX INTEGER
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"number of friend"
::= { friendsEntry 1 }
fName OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
ACCESS read-write
STATUS mandatory
DESCRIPTION
"Name of friend"
::= { friendsEntry 2 }
fAddress OBJECT-TYPE
SYNTAX DisplayString (SIZE (0..255))
ACCESS read-write
STATUS mandatory
DESCRIPTION
"Address of friend"
::= { friendsEntry 3 }
fStatus OBJECT-TYPE
SYNTAX
RowStatus
ACCESS
read-write
STATUS
mandatory
DESCRIPTION
"The status of this conceptual row."
::= { friendsEntry 4 }
fTrap TRAP-TYPE
ENTERPRISE example1
VARIABLES
{ myName, fIndex }
DESCRIPTION
"This trap is sent when something happens to
the friend specified by fIndex."
::= 1
END
1.8.2 Default Implementation
Without writing any instrumentation functions, we can compile the MIB and use the default implementation of it.
Recall that MIBs imported by "EX1-MIB.mib" must be present and compiled in the current directory ("./STANDARDMIB.bin","./RFC1213-MIB.bin") when compiling.
unix> erl -config ./sys
1> application:start(snmp).
ok
2> snmpc:compile("EX1-MIB").
No accessfunction for 'friendsTable', using default.
No accessfunction for 'myName', using default.
{ok, "EX1-MIB.bin"}
3> snmpa:load_mibs(snmp_master_agent, ["EX1-MIB"]).
ok
40 | Ericsson AB. All Rights Reserved.: Simple Network Management Protocol (SNMP)