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