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/snmpa.xml | 75 +++++++++++++++++++++++++++++++++++++++-------
1 file changed, 65 insertions(+), 10 deletions(-)
(limited to 'lib/snmp/doc/src/snmpa.xml')
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