Download Simple Network Management Protocol (SNMP)

Transcript
Chapter 1: SNMP User's Guide
f(set, NewValue [, ExtraArgs])
This function is called to perform the set in phase two of the set-request processing. It is only called if
the corresponding is set ok function is present and returns noError.
NewValue is guaranteed to be of the correct type, length and within ranges, as specified in the MIB. If
the object is an enumerated integer or of type BITS, the integer value is used.
This function is mandatory.
Valid return values
noError
genErr(SNMPv1)
commitFailed | undoFailed | genErr(SNMPv2)
1.9.2 Table Instrumentation
For tables, a f(Operation, ...) function should be defined (the function shown is exemplified with
f).
The Operation can be new, delete, get, next, is set ok, undo or set.
In case of an error, all instrumentation functions may return either an SNMPv1 or an SNMPv2 error
code. If it returns an SNMPv2 code, it is converted into an SNMPv1 code before it is sent to a SNMPv1
manager. It is recommended to use the SNMPv2 error codes for all instrumentation functions, as these
provide more details. See Appendix A [page 58] for a description of error code conversions.
f(new [, ExtraArgs])
The function f(new [, ExtraArgs]) is called for each object in an MIB when the MIB is loaded into
the agent. This makes it possible to perform the necessary initialization.
This function is optional. The return value is discarded.
f(delete [, ExtraArgs])
The function f(delete [, ExtraArgs]) is called for each object in an MIB when the MIB is unloaded
from the agent. This makes it possible to perform any necessary clean-up.
This function is optional. The return value is discarded.
f(get, RowIndex, Cols [, ExtraArgs])
The function f(get, RowIndex, Cols [, ExtraArgs]) is called when a get-request refers to a table.
This function is mandatory.
Arguments
RowIndex is a list of integers which define the key values for the row. The RowIndex is the list
representation (list of integers) which follow the Cols integer in the OBJECT IDENTIFIER.
Cols is a list of integers which represent the column numbers. The Cols are sorted by increasing
value and are guaranteed to be valid column numbers.
52
Simple Network Management Protocol (SNMP)