From 8f929fad475601ee3cb164a26db3a9065fa7f909 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Sun, 28 Apr 2013 20:23:44 +0200 Subject: [snmp/agent] Preliminary doc update regarding mib_data behaviour --- lib/snmp/doc/src/files.mk | 1 + lib/snmp/doc/src/notes.xml | 129 ----------------------- lib/snmp/doc/src/snmp_config.xml | 18 +++- lib/snmp/doc/src/snmpa_mib_data.xml | 201 ++++++++++++++++++++++++++++++++++++ 4 files changed, 218 insertions(+), 131 deletions(-) create mode 100644 lib/snmp/doc/src/snmpa_mib_data.xml (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/files.mk b/lib/snmp/doc/src/files.mk index 61c91c9729..e215143b03 100644 --- a/lib/snmp/doc/src/files.mk +++ b/lib/snmp/doc/src/files.mk @@ -41,6 +41,7 @@ XML_AGENT_REF3_FILES = \ snmpa_error_io.xml \ snmpa_error_logger.xml \ snmpa_local_db.xml \ + snmpa_mib_data.xml \ snmpa_mpd.xml \ snmpa_network_interface.xml \ snmpa_network_interface_filter.xml \ diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 5222922848..b47d4237f5 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -1017,135 +1017,6 @@ -
- SNMP Development Toolkit 4.19 -

Version 4.19 supports code replacement in runtime from/to - version 4.18.

- -
- Improvements and new features - - - -

[compiler] Added support for textual convention - AGENT-CAPABILITIES and "full" support for textual - convention MODULE-COMPLIANCE, both defined by the SNMPv2-CONF - mib.

-

The reference and modules part(s) are - stored in the assocList of the mib-entry (me) - record. - Only handled if the option(s) agent_capabilities - and module_compliance (respectively) are provided to the - compiler.

-

See compile/2 - for more info.

-

For backward compatibillity, the MIBs provided with - this application are not compiled with these - options.

-

Own Id: OTP-8966

-
- - -

[agent] Added a "complete" set of (snmp) table and variable - print functions, for each mib handled by the SNMP (agent) - application. This will be usefull when debugging a running agent.

-

See - print_mib_info/0, - print_mib_tables/0 - and - print_mib_variables/0 - for more info.

-

Own Id: OTP-8977

-
- - -

[compiler] Added a MIB compiler (frontend) escript, - snmpc.

-

Own Id: OTP-9004

-
- -
-
- -
- Fixed Bugs and Malfunctions - - - -

[agent] For the table vacmAccessTable, - when performing the is_set_ok and set operation(s), - all values of the vacmAccessSecurityModel column was - incorrectly translated to any.

- -

Own Id: OTP-8980

-
- - -

[agent] When calling - snmp_view_based_acm_mib:reconfigure/1 - on a running node, the table vacmAccessTable was not properly - cleaned. - This meant that if some entries in the vacm.conf file was removed - (compared to the current config), - while others where modified and/or added, the removed entrie(s) - would still exist in the vacmAccessTable table.

-

Own Id: OTP-8981

-

Aux Id: Seq 11750

-
- -
-
- - -
- Incompatibilities -

-

-
- -
- - -
- SNMP Development Toolkit 4.18 -

Version 4.18 supports code replacement in runtime from/to - version 4.17.1 and 4.17.

- -
- Improvements and new features - - -

Prepared for R14B release.

-
-
-
- -
Fixed Bugs and Malfunctions -

-

- -
- -
- Incompatibilities -

-

-
-
- - + + + + + + -- cgit v1.2.3 From 61ac3a2188af0f5d96ef9e1143845a12093acf4c Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 30 Apr 2013 23:29:13 +0200 Subject: [snmp/agent] Some minor documentation additions --- lib/snmp/doc/src/snmpa_mib_data.xml | 40 ++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/snmpa_mib_data.xml b/lib/snmp/doc/src/snmpa_mib_data.xml index 462112ac71..eeeb124d9d 100644 --- a/lib/snmp/doc/src/snmpa_mib_data.xml +++ b/lib/snmp/doc/src/snmpa_mib_data.xml @@ -180,7 +180,7 @@ Find the mib-entry corresponding to the Oid State = term() - Reply = {variable, ME} | {table_column, ME, TEOid} | {subagent, SAPid, SAOid} | [false, Reason} + Reply = {variable, ME} | {table_column, ME, TEOid} | {subagent, SAPid, SAOid} | {false, Reason} Oid = TEOid = SAOid = oid() SAPid = pid() ME = me() @@ -193,8 +193,46 @@ and if it is a table, Oid must be ....

+ + + + + + + next(State, Oid, MibView) -> Reply + Finds the lexicographically next oid + + State = term() + Reply = false | endOfTable | {subagent, SAPid, SAOid} | {variable, ME, VarOid} | {table, TableOid, TableRestOid, ME} + Oid = SAOid = VarOid = TableOid = TableRestOid = oid() + SAPid = pid() + ME = me() + + +

Finds the lexicographically next oid.

+ +
+ + + register_subagent(State, Oid, Pid) -> Reply + Register the subagent + + State = NewState = term() + Reply = {ok, NewState} | {error, Reason} + Oid = oid() + Pid = pid() + Reason = term() + + +

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

+ + +
+
+ -- cgit v1.2.3 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 From 2d71b25ef2f0edf15012a5f81210ce7f9fe507e8 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 17 May 2013 19:35:57 +0200 Subject: [snmp/agent] Improved mib-server data module overview text --- lib/snmp/doc/src/snmpa_mib_data.xml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/snmpa_mib_data.xml b/lib/snmp/doc/src/snmpa_mib_data.xml index 8e79bb1673..4c971ec5d9 100644 --- a/lib/snmp/doc/src/snmpa_mib_data.xml +++ b/lib/snmp/doc/src/snmpa_mib_data.xml @@ -90,8 +90,9 @@

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 +

Note that the data extracted from the imported (loaded) + mibs are stored partly by the mib-server and partly by the + symbolic-store server. See the default mib-server data module, snmpa_mib_data_tttn for details.

-- cgit v1.2.3 From 3ffa5b5c87518b6579f48b935cb67c7eb22b10b4 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 21 May 2013 11:52:14 +0200 Subject: [snmp/agent] Some mib-server options rewording --- lib/snmp/doc/src/snmp_app.xml | 32 ++++++++++++++++---------------- lib/snmp/doc/src/snmp_config.xml | 34 +++++++++++++++++----------------- 2 files changed, 33 insertions(+), 33 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index 6ce5285a68..c7a74f0ca6 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -340,7 +340,7 @@ ]]> -

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

+

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

Defines options specific for the SNMP agent mib server.

For defaults see the options in mib_server_opt().

@@ -367,12 +367,12 @@ - ]]> + ]]> -

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

Defines the backend data 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, @@ -406,30 +406,30 @@ ]]>

Defines if the mib server shall perform cache gc automatically or - leave it to the user (see - gc_mibs_cache/0,1,2,3).

+ leave it to the user (see + gc_mibs_cache/0,1,2,3).

Default is true.

0 ]]> -

Defines how old the entries in the cache will be allowed before - they are GC'ed (assuming GC is performed). Each entry in the - cache is "touched" whenever it is accessed.

-

The age is defined in milliseconds.

-

Default is 10 timutes.

+

Defines how old the entries in the cache will be allowed + to become before they are GC'ed (assuming GC is performed). + Each entry in the cache is "touched" whenever it is accessed.

+

The age is defined in milliseconds.

+

Default is 10 timutes.

0 | infinity ]]>

When performing a GC, this is the max number of cache entries - that will be deleted from the cache.

+ that will be deleted from the cache.

The reason for having this limit is that if the cache is - large, the GC can potentially take a long time, during which - the agent is locked.

-

Default is 100.

+ large, the GC can potentially take a long time, during which + the agent is locked.

+

Default is 100.

diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 4e2e932b46..28bfcbb3de 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()} | {data_module, mib_data_module()}

+

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

Defines options specific for the SNMP agent mib server.

For defaults see the options in mib_server_opt().

@@ -364,12 +364,12 @@ - ]]> + ]]> -

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

Defines the backend data 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, @@ -403,18 +403,18 @@ ]]>

Defines if the mib server shall perform cache gc automatically or - leave it to the user (see - gc_mibs_cache/0,1,2,3).

-

Default is true.

+ leave it to the user (see + gc_mibs_cache/0,1,2,3).

+

Default is true.

0 ]]> -

Defines how old the entries in the cache will be allowed before - they are GC'ed (assuming GC is performed). Each entry in the - cache is "touched" whenever it is accessed.

-

The age is defined in milliseconds.

+

Defines how old the entries in the cache will be allowed + to become before they are GC'ed (assuming GC is performed). + Each entry in the cache is "touched" whenever it is accessed.

+

The age is defined in milliseconds.

Default is 10 timutes.

@@ -422,11 +422,11 @@ 0 | infinity ]]>

When performing a GC, this is the max number of cache entries - that will be deleted from the cache.

-

The reason for having this limit is that if the cache is - large, the GC can potentially take a long time, during which - the agent is locked.

-

Default is 100.

+ that will be deleted from the cache.

+

The reason for having this limit is that if the cache is + large, the GC can potentially take a long time, during which + the agent is locked.

+

Default is 100.

-- cgit v1.2.3 From 31b06641f692641f82c489069584220609e1e840 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 21 May 2013 11:17:44 +0200 Subject: [snmp/agent] backup --- lib/snmp/doc/src/snmp_app.xml | 48 ++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index c7a74f0ca6..9cdbcc91c5 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -312,29 +312,31 @@ - ]]> - -

Specifies how info retrieved from the mibs will be stored.

-

If mib_storage is {ets, Dir}, the table will also be - stored on file. If Dir is default, then db_dir - will be used.

-

If mib_storage is dets or if Dir is - default, then db_dir will be used for Dir.

-

If mib_storage is mnesia then erlang:nodes() - will be used for Nodes.

-

Default is ets.

-

Dir = default | string(). Dir is the directory where the - files will be stored. If default, then db_dir will be - used.

-

Nodes = visible | connected | [node()]. - Nodes = visible is translated to - erlang:nodes(visible). - Nodes = connected is translated to - erlang:nodes(connected). - If Nodes = [] then the own node is assumed.

-

Action = clear | keep. Default is keep. - Action is used to specify what shall be done if the - mnesia/dets table already exist.

+ + +

mib_storage_opt() = {module, mib_storage_module()} | {options, list()}

+

This option specifies how basic mib data is stored. + This option is used by two parts of the snmp agent: + The mib-server and the symbolic-store.

+

Default is [{module, snmpa_mib_storage_ets}].

+
+ + + ]]> + +

Defines the callback 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.

-- cgit v1.2.3 From 4e7bd62bf3b38b40eee02766b0ad68fdf75fa1c9 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 21 May 2013 15:00:42 +0200 Subject: [snmp/agent] Add mib-storage behaviour ref-man documentation --- lib/snmp/doc/src/files.mk | 1 + lib/snmp/doc/src/notes.xml | 13 +++++ lib/snmp/doc/src/ref_man.xml | 1 + lib/snmp/doc/src/snmp_app.xml | 94 +++++++++++++++++++++++++++++------ lib/snmp/doc/src/snmp_config.xml | 98 +++++++++++++++++++++++++++++++++++++ lib/snmp/doc/src/snmpa_mib_data.xml | 2 +- 6 files changed, 193 insertions(+), 16 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/files.mk b/lib/snmp/doc/src/files.mk index e215143b03..494c550fff 100644 --- a/lib/snmp/doc/src/files.mk +++ b/lib/snmp/doc/src/files.mk @@ -42,6 +42,7 @@ XML_AGENT_REF3_FILES = \ snmpa_error_logger.xml \ snmpa_local_db.xml \ snmpa_mib_data.xml \ + snmpa_mib_storage.xml \ snmpa_mpd.xml \ snmpa_network_interface.xml \ snmpa_network_interface_filter.xml \ diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 2dfe347e42..b6c7c22fb0 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -56,6 +56,19 @@ data_module.

Own Id: OTP-11101

+ + +

[agent] Introduced a documented behaviour for the + mib storage. + At present there are three simple modules + (snmpa_mib_storage_ets, snmpa_mib_storage_dets and + snmpa_mib_storage_mnesia) implementíng this behaviour, + provided with the app.

+

A config option for the (agent) + mib storage + has been added to the agent config options.

+

Own Id: OTP-11107

+
diff --git a/lib/snmp/doc/src/ref_man.xml b/lib/snmp/doc/src/ref_man.xml index 2c12ac665a..628b30b11a 100644 --- a/lib/snmp/doc/src/ref_man.xml +++ b/lib/snmp/doc/src/ref_man.xml @@ -45,6 +45,7 @@ + diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index 9cdbcc91c5..c62c8f1541 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -311,8 +311,8 @@

Default is [].

- - + + ]]>

mib_storage_opt() = {module, mib_storage_module()} | {options, list()}

This option specifies how basic mib data is stored. @@ -322,21 +322,85 @@ - ]]> + -

Defines the callback mib data storage module of the - SNMP agent mib-server as defined by the - snmpa_mib_data +

Defines the mib storage module of the SNMP agent as defined by the + snmpa_mib_storage behaviour.

-

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

- -

Default module is snmpa_mib_data_tttn.

+

Several entities (mib-server via the its data module and + the symbolic-store) of the snmp agent uses this for storage + of miscelaneous mib data.

+

There are several implementations provided with the agent: + snmpa_mib_storage_ets, snmpa_mib_storage_dets and + snmpa_mib_storage_mnesia.

+

Default module is snmpa_mib_storage_ets.

+
+ + + ]]> + +

This is implementattion depended. That is, it depends on the + module. For each module a specific set of options are valid:

+ + +

snmpa_mib_storage_ets: {dir, filename()} | {action, keep | clear}, {checksum, boolean()}

+ + +

dir - If present, points to a directory where a file + to which all data in the ets table is "synced".

+

Also, when a table is opened this file is read, + if it exists.

+

By default, this will not be used.

+
+ +

action - Specifies the behaviour when a non-empty + file is found: Keep its content or clear it out.

+

Default is keep.

+
+ +

checksum - Defines if the file is checksummed + or not.

+

Default is false.

+
+
+
+ +

snmpa_mib_storage_dets: {dir, filename()} | {action, keep | clear}, {auto_save, default | pos_integer()} | {repair, force | boolean()}

+ + +

dir - This mandatory option points to a + directory where to place the file of a dets table.

+
+ +

action - Specifies the behaviour when a non-empty + file is found: Keep its content or clear it out.

+

Default is keep.

+
+ +

auto_save - Defines the dets auto-save frequency.

+

Default is default.

+
+ +

repair - Defines the dets repair behaviour.

+

Default is false.

+
+
+
+ +

snmpa_mib_storage_mnesia: {action, keep | clear}, {nodes, [node()]}

+ + +

action - Specifies the behaviour when a non-empty, + already existing, table: Keep its content or clear it out.

+

Default is keep.

+
+ +

nodes - Defines where to open the table.

+

Default is the result of the call: erlang:nodes().

+
+
+
+
diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index 28bfcbb3de..a88111085f 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -308,6 +308,103 @@

Default is [].

+ + ]]> + +

mib_storage_opt() = {module, mib_storage_module()} | {options, list()}

+

This option specifies how basic mib data is stored. + This option is used by two parts of the snmp agent: + The mib-server and the symbolic-store.

+

Default is [{module, snmpa_mib_storage_ets}].

+
+ + + + +

Defines the mib storage module of the SNMP agent as defined by the + snmpa_mib_storage + behaviour.

+

Several entities (mib-server via the its data module and + the symbolic-store) of the snmp agent uses this for storage + of miscelaneous mib data.

+

There are several implementations provided with the agent: + snmpa_mib_storage_ets, snmpa_mib_storage_dets and + snmpa_mib_storage_mnesia.

+

Default module is snmpa_mib_storage_ets.

+
+ + + ]]> + +

This is implementattion depended. That is, it depends on the + module. For each module a specific set of options are valid:

+ + +

snmpa_mib_storage_ets: {dir, filename()} | {action, keep | clear}, {checksum, boolean()}

+ + +

dir - If present, points to a directory where a file + to which all data in the ets table is "synced".

+

Also, when a table is opened this file is read, + if it exists.

+

By default, this will not be used.

+
+ +

action - Specifies the behaviour when a non-empty + file is found: Keep its content or clear it out.

+

Default is keep.

+
+ +

checksum - Defines if the file is checksummed + or not.

+

Default is false.

+
+
+
+ +

snmpa_mib_storage_dets: {dir, filename()} | {action, keep | clear}, {auto_save, default | pos_integer()} | {repair, force | boolean()}

+ + +

dir - This mandatory option points to a + directory where to place the file of a dets table.

+
+ +

action - Specifies the behaviour when a non-empty + file is found: Keep its content or clear it out.

+

Default is keep.

+
+ +

auto_save - Defines the dets auto-save frequency.

+

Default is default.

+
+ +

repair - Defines the dets repair behaviour.

+

Default is false.

+
+
+
+ +

snmpa_mib_storage_mnesia: {action, keep | clear}, {nodes, [node()]}

+ + +

action - Specifies the behaviour when a non-empty, + already existing, table: Keep its content or clear it out.

+

Default is keep.

+
+ +

nodes - Defines where to open the table.

+

Default is the result of the call: erlang:nodes().

+
+
+
+
+
+ + ]]> diff --git a/lib/snmp/doc/src/snmpa_mib_data.xml b/lib/snmp/doc/src/snmpa_mib_data.xml index 4c971ec5d9..ff07a03b98 100644 --- a/lib/snmp/doc/src/snmpa_mib_data.xml +++ b/lib/snmp/doc/src/snmpa_mib_data.xml @@ -122,7 +122,7 @@ Module:close(State) -> void() - Close the mib-storage + Close the mib-server data instance State = term() -- cgit v1.2.3 From 39540e7c380f6cb218a2ec6324f6296fa8327dba Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Thu, 23 May 2013 12:35:38 +0200 Subject: [snmp/agent] Updated open options for the mnesia mib-storage module Updated the snmpa_mib_storage_mnesia module to handle alias atoms for the nodes option. Also, (git) added mib-storage behaviour ref-man. --- lib/snmp/doc/src/snmp_app.xml | 29 +++- lib/snmp/doc/src/snmp_config.xml | 29 +++- lib/snmp/doc/src/snmpa_mib_storage.xml | 292 +++++++++++++++++++++++++++++++++ 3 files changed, 344 insertions(+), 6 deletions(-) create mode 100644 lib/snmp/doc/src/snmpa_mib_storage.xml (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/snmp_app.xml b/lib/snmp/doc/src/snmp_app.xml index c62c8f1541..f5a6de1099 100644 --- a/lib/snmp/doc/src/snmp_app.xml +++ b/lib/snmp/doc/src/snmp_app.xml @@ -329,7 +329,7 @@ behaviour.

Several entities (mib-server via the its data module and the symbolic-store) of the snmp agent uses this for storage - of miscelaneous mib data.

+ of miscelaneous mib related data retrieved while loading a mib.

There are several implementations provided with the agent: snmpa_mib_storage_ets, snmpa_mib_storage_dets and snmpa_mib_storage_mnesia.

@@ -340,7 +340,8 @@ ]]>

This is implementattion depended. That is, it depends on the - module. For each module a specific set of options are valid:

+ module. For each module a specific set of options are valid. + For the module provided with the app, these options are supported:

snmpa_mib_storage_ets: {dir, filename()} | {action, keep | clear}, {checksum, boolean()}

@@ -395,7 +396,29 @@

Default is keep.

-

nodes - Defines where to open the table.

+

nodes - A list of node names (or an atom + describing a list of nodes) defining where to open the table. + Its up to the user to ensure that mnesia is actually running + on the specified nodes.

+

The following distinct values are recognised:

+ + +

[] - Translated into a list of the own node: [node()]

+
+ +

all - erlang:nodes()

+
+ +

visible - erlang:nodes(visible)

+
+ +

connected - erlang:nodes(connected)

+
+ +

db_nodes - mnesia:system_info(db_nodes)

+
+
+

Default is the result of the call: erlang:nodes().

diff --git a/lib/snmp/doc/src/snmp_config.xml b/lib/snmp/doc/src/snmp_config.xml index a88111085f..f1acebf2f7 100644 --- a/lib/snmp/doc/src/snmp_config.xml +++ b/lib/snmp/doc/src/snmp_config.xml @@ -326,7 +326,7 @@ behaviour.

Several entities (mib-server via the its data module and the symbolic-store) of the snmp agent uses this for storage - of miscelaneous mib data.

+ of miscelaneous mib related data dataretrieved while loading a mib.

There are several implementations provided with the agent: snmpa_mib_storage_ets, snmpa_mib_storage_dets and snmpa_mib_storage_mnesia.

@@ -337,7 +337,8 @@ ]]>

This is implementattion depended. That is, it depends on the - module. For each module a specific set of options are valid:

+ module. For each module a specific set of options are valid. + For the module provided with the app, these options are supported:

snmpa_mib_storage_ets: {dir, filename()} | {action, keep | clear}, {checksum, boolean()}

@@ -392,7 +393,29 @@

Default is keep.

-

nodes - Defines where to open the table.

+

nodes - A list of node names (or an atom + describing a list of nodes) defining where to open the table. + Its up to the user to ensure that mnesia is actually running + on the specified nodes.

+

The following distinct values are recognised:

+ + +

[] - Translated into a list of the own node: [node()]

+
+ +

all - erlang:nodes()

+
+ +

visible - erlang:nodes(visible)

+
+ +

connected - erlang:nodes(connected)

+
+ +

db_nodes - mnesia:system_info(db_nodes)

+
+
+

Default is the result of the call: erlang:nodes().

diff --git a/lib/snmp/doc/src/snmpa_mib_storage.xml b/lib/snmp/doc/src/snmpa_mib_storage.xml new file mode 100644 index 0000000000..a857ce79e8 --- /dev/null +++ b/lib/snmp/doc/src/snmpa_mib_storage.xml @@ -0,0 +1,292 @@ + + + + +
+ + 20132013 + Ericsson AB. All Rights Reserved. + + + The contents of this file are subject to the Erlang Public License, + Version 1.1, (the "License"); you may not use this file except in + compliance with the License. You should have received a copy of the + Erlang Public License along with this software. If not, it can be + retrieved online at http://www.erlang.org/. + + Software distributed under the License is distributed on an "AS IS" + basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See + the License for the specific language governing rights and limitations + under the License. + + + + snmpa_mib_storage + + + + + snmpa_mib_storage.xml +
+ + snmpa_mib_storage + + Behaviour module for the SNMP agent mib storage. + + +

This module defines the behaviour of the SNMP agent mib storage.

+

The mib storage is used by the agent to store internal mib- + related information. The mib storage module is used by several entities, + not just the mib-server.

+ +

A snmpa_mib_storage compliant module + must export the following functions:

+ + + open/5 + + + close/1 + + + read/2 + + + write/2 + + + delete/1 + + + delete/2 + + + match_object/2 + + + match_delete/2 + + + tab2list/1 + + + info/1 + + + sync/1 + + + backup/2 + + + +

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

+ +
+ +
+ CALLBACK FUNCTIONS +

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

+ + +
+ + + + Module:open(Name, RecordName, Fields, Type, Options) -> {ok, TabId} | {error, Reason} + Create new (mib-server) data instance + + Name = atom() + RecordName = atom() + Fields = [atom()] + Type = set | bag() + Options = list() + TabId = term() + Reason = term() + + +

Create or open a mib storage table.

+

Note that the RecordName and Fields arguments + my not be used in all implementations (they are actually only + needed for mnesia-based implementations).

+ +

Note also that the Options argument comes from + the options config option of the mib-storage config option, + and is passed on as is.

+ + +
+
+ + + Module:close(TabId) -> void() + Close the mib-storage table + + State = term() + + +

Close the mib-storage table.

+ + +
+
+ + + Module:read(TabId, Key) -> false | {value, Record} + Read a record from the mib-storage table + + TabId = term() + Key = term() + Record = tuple() + + +

Read a record from the mib-storage table.

+ + +
+
+ + + Module:write(TabId, Record) -> ok | {error, Reason} + Write a record to the mib-storage table + + TabId = term() + Record = tuple() + Reason = term() + + +

Write a record to the mib-storage table.

+ + +
+
+ + + Module:delete(TabId) -> void() + Delete an entire mib-storage table + + TabId = term() + + +

Delete an entire mib-storage table.

+ + +
+
+ + + Module:delete(TabId, Key) -> ok | {error, Reason} + Delete a record from the mib-storage table + + TabId = term() + Key = term() + Reason = term() + + +

Delete a record from the mib-storage table.

+ + +
+
+ + + Module:match_object(TabId, Pattern) -> {ok, Recs} | {error, Reason} + Search the mib-storage table for record matching pattern + + TabId = term() + Pattern = match_pattern() + Recs = [tuple()] + Reason = term() + + +

Search the mib-storage table for record that match the + specified pattern.

+ + +
+
+ + + Module:match_delete(TabId, Pattern) -> {ok, Recs} | {error, Reason} + Delete records in the mib-storage table matching pattern + + TabId = term() + Pattern = match_pattern() + Recs = [tuple()] + Reason = term() + + +

Search the mib-storage table for record that match the + specified pattern and then delete them. The records deleted are + also returned.

+ + +
+
+ + + Module:tab2list(TabId) -> Recs + Return all records of the mib-storage table + + TabId = term() + Recs = [tuple()] + + +

Return all records in the mib-storage table in the form + of a list.

+ + +
+
+ + + Module:info(TabId) -> {ok, Info} | {error, Reason} + Returns information about the mib-storage table. + + TabId = term() + Info = term() + Reason = term() + + +

Retrieve implementation dependent mib-storage table + information.

+ + +
+
+ + + Module:sync(TabId) -> void() + Synchronize mib-storage table + + TabId = term() + + +

Synchronize the mib-storage table.

+

What this means, if anything, is implementation dependent.

+ + +
+
+ + + Module:backup(TabId, BackupDir) -> ok | {error, Reason} + Perform a backup of the mib-storage table + + TabId = term() + BackupDir = string() + Reason = term() + + +

Perform a backup of the mib-storage table.

+

What this means, if anything, is implementation dependent.

+ +
+
+ +
+ +
+ -- cgit v1.2.3 From a9244ce9be2d73397ed71fb9d7d5986c5f70e202 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Tue, 28 May 2013 17:04:31 +0200 Subject: [snmp] Updated version and release notes OTP-11009 --- lib/snmp/doc/src/notes.xml | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 5222922848..6d617e8bba 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,73 @@ +
+ 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 +

-

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

[agent,manager] Updated to support the new crypto interface.

+

Own Id: OTP-11009

+
+ +
+ +
+ +
+ Incompatibilities +

-

+ + +
+ +
+ +
SNMP Development Toolkit 4.23.1

Version 4.23.1 supports code replacement in runtime from/to -- cgit v1.2.3