From 622952a654c2c8dd6ada8e0001343dfe2bce72e2 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Fri, 2 Aug 2013 15:35:54 +0200 Subject: [snmp/agent] Improved loading and unload of MIBs Improved the documentation of the loading and unloading of MIBs (plural). also added functions for loading and unloading a single mib. OTP-11216 --- lib/snmp/doc/src/notes.xml | 67 +++++++++++++++++++++++++++++++++++++++++ lib/snmp/doc/src/snmpa.xml | 75 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 132 insertions(+), 10 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 21c417f0c1..8ba2161a9d 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -33,6 +33,73 @@ +
+ SNMP Development Toolkit 4.24.2 +

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

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

[agent] Improved documentation for the functions for + loading and unloading mibs, + see load_mibs and + unload_mibs for + more info.

+

Also added new functions for loading and unloading a single mib, + see load_mib and + unload_mib for + more info.

+

Own Id: OTP-11216

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

-

+ + + +
+ +
+ Incompatibilities +

-

+ + +
+ +
+ +
SNMP Development Toolkit 4.24.1

Version 4.24.1 supports code replacement in runtime from/to diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index 86fde03205..77146f3a89 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -245,29 +245,75 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} This function is used to convert to the old (pre-4.4) info format.

+ + + + + + load_mib(Mib) -> ok | {error, Reason} + load_mib(Agent, Mib) -> ok | {error, Reason} + Load single MIB into the agent + + Agent = pid() | atom() + MibName = string() + Reason = already_loaded | term() + + +

Load a single Mib into an agent. The MibName + is the name of the Mib, including the path to where the compiled + mib is found. For example:

+ + Dir = code:priv_dir(my_app) ++ "/mibs/", + snmpa:load_mib(snmp_master_agent, Dir ++ "MY-MIB"). + +
load_mibs(Mibs) -> ok | {error, Reason} - load_mibs(Agent,Mibs) -> ok | {error, Reason} + load_mibs(Mibs, Force) -> ok | {error, Reason} + load_mibs(Agent, Mibs) -> ok | {error, Reason} + load_mibs(Agent, Mibs, Force) -> ok | {error, Reason} Load MIBs into the agent Agent = pid() | atom() Mibs = [MibName] + Force = boolean() MibName = string() - Reason = term() + Reason = {'load aborted at', MibName, InternalReason} + InternalReason = already_loaded | term() -

Loads Mibs into an agent. If the agent cannot load - all MIBs, it will indicate where loading was aborted. The - MibName is the name of the Mib, including the path to - where the compiled mib is found. For example,

- +

Load Mibs into an agent. If the agent cannot load all + MIBs (the default value of the Force argument is false), + it will indicate where loading was aborted. The MibName + is the name of the Mib, including the path to where the compiled + mib is found. For example,

+ Dir = code:priv_dir(my_app) ++ "/mibs/", snmpa:load_mibs(snmp_master_agent, [Dir ++ "MY-MIB"]). +

If Force = true then the agent will continue attempting + to load each mib even after failing to load a previous mib. Use with + care.

+ + +
+
+ + + unload_mib(Mib) -> ok | {error, Reason} + unload_mib(Agent, Mib) -> ok | {error, Reason} + Unload single MIB from the agent + + Agent = pid() | atom() + MibName = string() + Reason = not_loaded | term() + + +

Unload a single Mib from an agent.

@@ -275,16 +321,25 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} unload_mibs(Mibs) -> ok | {error, Reason} - unload_mibs(Agent,Mibs) -> ok | {error, Reason} + unload_mibs(Mibs, Force) -> ok | {error, Reason} + unload_mibs(Agent, Mibs) -> ok | {error, Reason} + unload_mibs(Agent, Mibs, Force) -> ok | {error, Reason} Unload MIBs from the agent Agent = pid() | atom() Mibs = [MibName] + Force = boolean() MibName = string() + Reason = {'unload aborted at', MibName, InternalReason} + InternalReason = not_loaded | term() -

Unloads MIBs into an agent. If it cannot unload all MIBs, - it will indicate where unloading was aborted.

+

Unload Mibs from an agent. If it cannot unload all MIBs + (the default value of the Force argument is false), + it will indicate where unloading was aborted.

+

If Force = true then the agent will continue attempting + to unload each mib even after failing to unload a previous mib. + Use with care.

-- cgit v1.2.3 From ffe1e03bf636f6d57715e82a00edb065d2b6ff40 Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 2 Sep 2013 11:27:08 +0200 Subject: [snmp/agent] Fixed doc broken link to gen_server --- lib/snmp/doc/src/snmpa_mib_data.xml | 2 +- 1 file changed, 1 insertion(+), 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 ff07a03b98..c1ea0a91f9 100644 --- a/lib/snmp/doc/src/snmpa_mib_data.xml +++ b/lib/snmp/doc/src/snmpa_mib_data.xml @@ -380,7 +380,7 @@

Perform a code-change (upgrade or downgrade).

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

-- cgit v1.2.3