I'm writing an SNMP manager and a simulated SNMP agent from a MIB (to test a manager). I have a table similar to below that the manager should be able to add/delete rows. What's the customary way to do this using RowStatus? Is RowStatus set first? Can other OIDs be included in the PDU?
My initial use case is the table is empty at startup. So if I send a SET PDU like this:
createStuffEntry.1.1.1 = 1
createStuffEntry.2.1.1 = 1
createStuffEntry.3.1.1 = 99
createStuffEntry.4.1.1 = "Dustbunnies"
createStuffEntry.5.1.1 = 5
Should that work for the definition below? What should happen if cRowStatus is left out?
createStuffTable OBJECT-TYPE
SYNTAX SEQUENCE OF CreateStuffEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"A table for creating stuff."
::= { parentGroup 1 }
createStuffEntry OBJECT-TYPE
SYNTAX CreateStuffEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"An entry for building a stuff to create."
INDEX { cPlanID, cID }
::= { createStuffTable 1 }
CreateStuffEntry ::=
SEQUENCE {
cPlanID
INTEGER,
cID
INTEGER,
cTemplateID
INTEGER,
cStuffName
DisplayString,
cRowStatus
RowStatus
}
cPlanID OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The plan ID (cpPlanID)"
::= { createStuffEntry 1 }
cID OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The table entry index."
::= { createStuffEntry 2 }
cTemplateID OBJECT-TYPE
SYNTAX INTEGER
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The ID of the stuff template to create this stuff from."
::= { createStuffEntry 3 }
cStuffName OBJECT-TYPE
SYNTAX DisplayString
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The stuff name."
::= { createStuffEntry 4 }
cRowStatus OBJECT-TYPE
SYNTAX RowStatus
ACCESS read-write
STATUS current
DESCRIPTION
"This OID uses six main statuses:
active(1) is in use and available in stuffTable
notinService(2) it is present but not yet created
notReady(3) it is present but missing info
createAndGo(4) create stuff in stuffTable. Row will be
added to this table if necessary.
createAndWait(5) add stuff row to this table
destroy(6) will remove the stuff row
This OID is used to add/remove rows for stuff creation.
It can also be used to determine if a stuff has been
created successfully."
::= { createStuffEntry 5 }
Note this is a SMI v1 MIB using RowStatus as a defined type, similar to that described here. Thus read-create is implied, rather than stated here.