From 2d56595da89d9225d150912228cb158e80584f8e Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 16 May 2013 19:43:59 +0200 Subject: [snmp/agent] Updated documentation and release notes --- lib/snmp/doc/src/notes.xml | 69 +++++++++++ lib/snmp/doc/src/ref_man.xml | 1 + lib/snmp/doc/src/snmp_app.xml | 27 ++++- lib/snmp/doc/src/snmp_config.xml | 31 +++-- lib/snmp/doc/src/snmpa_mib_data.xml | 232 +++++++++++++++++++++++++++++------- 5 files changed, 305 insertions(+), 55 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index b47d4237f5..2dfe347e42 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,75 @@ +
+ SNMP Development Toolkit 4.24 +

Version 4.24 supports code replacement in runtime from/to + version 4.23.1 and 4.23.

+ +
+ Improvements and new features + + + + +

[agent] Introduced a documented behaviour for the mib-server + mib-data backend. + At present only the default module (snmpa_mib_data_tttn) is + provided.

+

A config option for the (agent) + mib-servers + mib-data backend module has been added to the agent config options, + data_module.

+

Own Id: OTP-11101

+
+
+ +
+ +
+ Fixed Bugs and Malfunctions + + + + +

[compiler] Now handles MIBs importing the pesudotype BITS.

+

Own Id: OTP-10799

+
+ + +

[compiler] The MIB compiler could not handle a table index + that was defined later in the MIB.

+

Own Id: OTP-10808

+
+ +
+ +
+ +
+ Incompatibilities +

-

+ + +
+ +
+ +
SNMP Development Toolkit 4.23.1

Version 4.23.1 supports code replacement in runtime from/to diff --git a/lib/snmp/doc/src/ref_man.xml b/lib/snmp/doc/src/ref_man.xml index 92e8927f6d..2c12ac665a 100644 --- a/lib/snmp/doc/src/ref_man.xml +++ b/lib/snmp/doc/src/ref_man.xml @@ -44,6 +44,7 @@ + diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index 62dfa515d1..6ce5285a68 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -4,7 +4,7 @@

- 19972012 + 19972013 Ericsson AB. All Rights Reserved. @@ -340,7 +340,7 @@ ]]> -

mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()}

+

mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()} | {data_module, mib_data_module()}

Defines options specific for the SNMP agent mib server.

For defaults see the options in mib_server_opt().

@@ -365,7 +365,28 @@

Default is false.

- + + + ]]> + +

Defines the backend mib_data storage module of the + SNMP agent mib-server as defined by the + snmpa_mib_data + behaviour.

+

At present only the default module is provided with the agent, + snmpa_mib_data_tttn.

+ +

Default module is snmpa_mib_data_tttn.

+
+ + ]]>

Shall the agent utilize the mib server lookup cache or not.

diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 42831ecb34..4e2e932b46 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -337,7 +337,7 @@ ]]> -

mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()} | {mob_data_mod, mib_data_mod()}

+

mib_server_opt() = {mibentry_override, mibentry_override()} | {trapentry_override, trapentry_override()} | {verbosity, verbosity()} | {cache, mibs_cache()} | {data_module, mib_data_module()}

Defines options specific for the SNMP agent mib server.

For defaults see the options in mib_server_opt().

@@ -362,28 +362,35 @@

Default is false.

- - ]]> - -

Shall the agent utilize the mib server lookup cache or not.

-

Default is true (in which case the mibs_cache_opts() - default values apply).

-
- - - ]]> + + + ]]>

Defines the backend mib_data storage module of the SNMP agent mib-server as defined by the snmpa_mib_data behaviour.

+

At present only the default module is provided with the agent, + snmpa_mib_data_tttn.

+

Default module is snmpa_mib_data_tttn.

+ + ]]> + +

Shall the agent utilize the mib server lookup cache or not.

+

Default is true (in which case the mibs_cache_opts() + default values apply).

+
+ ]]> diff --git a/lib/snmp/doc/src/snmpa_mib_data.xml b/lib/snmp/doc/src/snmpa_mib_data.xml index eeeb124d9d..8e79bb1673 100644 --- a/lib/snmp/doc/src/snmpa_mib_data.xml +++ b/lib/snmp/doc/src/snmpa_mib_data.xml @@ -23,10 +23,7 @@ snmpa_mib_data - - - snmpa_mib_data.xml @@ -41,76 +38,89 @@ must export the following functions:

-

new/1

+ new/1
-

close/1

+ close/1
-

sync/1

+ sync/1
-

load_mib/4

+ load_mib/4
-

unload_mib/4

+ unload_mib/4
-

lookup/2

+ lookup/2
-

next/3

+ next/3
-

register_subagent/3

+ register_subagent/3
-

unregister_subagent/2

+ unregister_subagent/2
-

which_mib/2

+ which_mib/2
-

which_mibs/1

+ which_mibs/1
-

whereis_mib/2

+ whereis_mib/2
-

backup/2

+ dump/2
-

dump/2

+ info/1
-

info/1,2

+ backup/2
-

code_change/2

+ code_change/4
-

The semantics of them and their exact signatures are explained - below.

- +

The semantics of them and their exact signatures are + explained below.

+ +

Note that some of the data need to be "passed on" to the + symbolic-store for storage, see the default mib-server data + module, snmpa_mib_data_tttn for details.

+ + +
+ CALLBACK FUNCTIONS +

The following functions must be exported from a + mib-server data callback module:

+ + +
+ - new(Storage) -> State - Create new (mib-storage) instance + Module:new(Storage) -> State + Create new (mib-server) data instance Storage = mib_storage() State = term() -

Create a new mib-storage instance.

+

Create a new mib-server data instance.

- close(State) -> void() + Module:close(State) -> void() Close the mib-storage State = term() @@ -123,13 +133,13 @@ - sync(State) -> void() + Module:sync(State) -> void() Synchronize to disc State = term() -

Synchronize (write to disc, if possible) the data to disc. +

Synchronize (write to disc, if possible) the mib-server data. This depends on the mib_storage option, and will only have an effect if the mib-storage option has an actual disc component (such as dets, or ets with a file).

@@ -139,7 +149,7 @@
- load_mib(State, Filename, MeOverride, TeOverride) -> {ok, NewState} | {error, Reason} + Module:load_mib(State, Filename, MeOverride, TeOverride) -> {ok, NewState} | {error, Reason} Load a mib into the mib-server State = NewState = term() @@ -160,7 +170,7 @@ - unload_mib(State, Filename) -> {ok, NewState} | {error, Reason} + Module:unload_mib(State, Filename) -> {ok, NewState} | {error, Reason} Unload mib from the mib-server State = NewState = term() @@ -176,7 +186,7 @@ - lookup(State, Oid) -> Reply + Module:lookup(State, Oid) -> Reply Find the mib-entry corresponding to the Oid State = term() @@ -187,19 +197,18 @@ Reason = term() -

Find the mib-entry corresponding to the Oid. - If it is a variable, the Oid must be - .0 - and if it is a table, Oid must be - ....

- +

Find the mib-entry corresponding to the Oid. + If it is a variable, the Oid must be + <Oid for var>.0 + and if it is a table, Oid must be + <table>.<entry>.<col>.<any>.

- next(State, Oid, MibView) -> Reply + Module:next(State, Oid, MibView) -> Reply Finds the lexicographically next oid State = term() @@ -216,7 +225,7 @@ - register_subagent(State, Oid, Pid) -> Reply + Module:register_subagent(State, Oid, Pid) -> Reply Register the subagent State = NewState = term() @@ -226,13 +235,156 @@ Reason = term() -

Register the the subagent, process, +

Register the subagent, process, handling part of the mib-tree.

+ + Module:unregister_subagent(State, PidOrOid) -> Reply + Unregister the subagent + + State = NewState = term() + Reply = {ok, NewState} | {ok, NewState, Pid} | {error, Reason} + PidOrOid = pid() | oid() + Pid = pid() + Reason = term() + + +

Unregister the subagent, handling part of the mib-tree, + as specified by the oid() or pid() + (PidOrOid).

+

When unregister the subagent using an oid(), the pid() + of the process handling the sub-tree is also returned.

+ + +
+
+ + + Module:dump(State, Destination) -> Reply + Unregister the subagent + + State = term() + Reply = ok | {error, Reason} + Destination = io | filename() + Pid = pid() + Reason = term() + + +

Dump the mib-server data to stdio (Destination = io) or + the specified file.

+ + +
+
+ + + Module:which_mib(State, Oid) -> Reply + Retrieve the mib file for an oid() + + State = term() + Reply = {ok, MibFile} | {error, Reason} + Oid = oid() + MibFile = string() + Reason = term() + + +

Retrieve the mib-file to which an given oid() belongs.

+ + +
+
+ + + Module:which_mibs(State) -> Reply + Retrieve all loaded mib files + + State = term() + Reply = [{MibName, Filename}] + MibName = atom() + Filename = string() + + +

Retrieve all loaded mib-files.

+ + +
+
+ + + Module:whereis_mib(State, MibName) -> Reply + Retrieve the mib file for the mib + + State = term() + MibName = atom() + Reply = {ok, Filename} | {error, Reason} + Filename = string() + Reason = term() + + +

Retrieve the mib file for the mib.

+ + +
+
+ + + Module:info(State) -> Reply + Retrieve misc info for the mib data + + State = term() + Reply = {ok, Filename} | {error, Reason} + Filename = string() + Reason = term() + + +

Retrieve misc info for the mib data.

+

This is a utility function used to inspect, for instance, + memory usage, in a simple way.

+ + +
+
+ + + Module:backup(State, BackupDir) -> Reply + Perform a backup of the mib-server data + + State = term() + Reply = ok | {error, Reason} + BackupDir = string() + Reason = term() + + +

Perform a backup of the mib-server data.

+

Note that its implementation dependant (and also + dependent on mib-storage is used) if a backup is possible.

+ + +
+
+ + + Module:code_change(Destination, Vsn, Extra, State) -> NewState + Perform a code-change + + Destination = up | down + Vsn = term() + Extra = term() + State = NewState = term() + + +

Perform a code-change (upgrade or downgrade).

+

See + gen_server + for more info regarding the Vsn and Extra arguments.

+ +
+
+ -- cgit v1.2.3