aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmp_standard_mib.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2012-02-27 16:09:38 +0100
committerMicael Karlberg <[email protected]>2012-02-27 16:09:38 +0100
commita05886528ce9a02a79eda82c8868f489dd478aaa (patch)
treea8060cb88342da0816c54a40cd3d7c1b6f516661 /lib/snmp/src/agent/snmp_standard_mib.erl
parentf6b7aade87b64c4c60eba65dfac6310a8c7bf139 (diff)
parentd11e013575ed400b7167342be4b08ba3d1166ee9 (diff)
downloadotp-a05886528ce9a02a79eda82c8868f489dd478aaa.tar.gz
otp-a05886528ce9a02a79eda82c8868f489dd478aaa.tar.bz2
otp-a05886528ce9a02a79eda82c8868f489dd478aaa.zip
Merge branch 'bmk/snmp/improve_error_handling_reading_config/OTP-9943' into bmk/snmp/snmp422_integration/r15
Conflicts: lib/snmp/doc/src/notes.xml lib/snmp/src/app/snmp.appup.src
Diffstat (limited to 'lib/snmp/src/agent/snmp_standard_mib.erl')
-rw-r--r--lib/snmp/src/agent/snmp_standard_mib.erl17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/snmp/src/agent/snmp_standard_mib.erl b/lib/snmp/src/agent/snmp_standard_mib.erl
index b6834d278c..7db94e7bd5 100644
--- a/lib/snmp/src/agent/snmp_standard_mib.erl
+++ b/lib/snmp/src/agent/snmp_standard_mib.erl
@@ -143,18 +143,24 @@ do_reconfigure(Dir) ->
%% Func: read_standard/1
%% Args: Dir is the directory with trailing dir_separator where
%% the configuration files can be found.
-%% Purpose: Reads th standard configuration file.
+%% Purpose: Reads the standard configuration file.
%% Returns: A list of standard variables
%% Fails: If an error occurs, the process will die with Reason
%% configuration_error.
+%% This file is mandatory, as it contains mandatory
+%% config options for which there are no default values.
%%-----------------------------------------------------------------
read_standard(Dir) ->
?vdebug("check standard config file",[]),
- Gen = fun(_) -> ok end,
- Filter = fun(Standard) -> sort_standard(Standard) end,
- Check = fun(Entry) -> check_standard(Entry) end,
+ FileName = "standard.conf",
+ Gen = fun(D, Reason) ->
+ throw({error, {failed_reading_config_file,
+ D, FileName, Reason}})
+ end,
+ Filter = fun(Standard) -> sort_standard(Standard) end,
+ Check = fun(Entry) -> check_standard(Entry) end,
[Standard] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, "standard.conf"}]),
+ snmp_conf:read_files(Dir, [{Gen, Filter, Check, FileName}]),
Standard.
@@ -548,6 +554,7 @@ snmp_set_serial_no(set, NewVal) ->
snmp_generic:variable_func(set, (NewVal + 1) rem 2147483648,
{snmpSetSerialNo, volatile}).
+
%%-----------------------------------------------------------------
%% This is the instrumentation function for sysOrTable
%%-----------------------------------------------------------------