aboutsummaryrefslogtreecommitdiffstats
path: root/lib/snmp/src/agent/snmp_notification_mib.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2014-04-09 10:29:00 +0200
committerRaimo Niskanen <[email protected]>2014-07-22 09:59:15 +0200
commit768a6d38597b8bedf6551ad2e6472b2965765dd2 (patch)
treee4eb4fb767d2c83954bdf63f1191497589e267b9 /lib/snmp/src/agent/snmp_notification_mib.erl
parent934b6de4d2ab6c31c5217e1ba4779ade9e37cc83 (diff)
downloadotp-768a6d38597b8bedf6551ad2e6472b2965765dd2.tar.gz
otp-768a6d38597b8bedf6551ad2e6472b2965765dd2.tar.bz2
otp-768a6d38597b8bedf6551ad2e6472b2965765dd2.zip
Rewrite agent configuration parsing
Diffstat (limited to 'lib/snmp/src/agent/snmp_notification_mib.erl')
-rw-r--r--lib/snmp/src/agent/snmp_notification_mib.erl24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/snmp/src/agent/snmp_notification_mib.erl b/lib/snmp/src/agent/snmp_notification_mib.erl
index 37e09f5d3e..31c7735226 100644
--- a/lib/snmp/src/agent/snmp_notification_mib.erl
+++ b/lib/snmp/src/agent/snmp_notification_mib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2012. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2014. 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
@@ -106,17 +106,19 @@ do_reconfigure(Dir) ->
read_notify_config_files(Dir) ->
?vdebug("read notify config file",[]),
FileName = "notify.conf",
- Gen = fun(D, Reason) ->
- info_msg("failed reading config file ~s"
- "~n Config Dir: ~s"
- "~n Reason: ~p",
- [FileName, D, Reason]),
- ok
- end,
- Filter = fun(Notifs) -> Notifs end,
- Check = fun(Entry) -> check_notify(Entry) end,
+ Gen =
+ fun (D, Reason) ->
+ info_msg("failed reading config file ~s"
+ "~n Config Dir: ~s"
+ "~n Reason: ~p",
+ [FileName, D, Reason]),
+ ok
+ end,
+ Order = fun snmp_conf:no_order/2,
+ Filter = fun snmp_conf:no_filter/1,
+ Check = fun (Entry, State) -> {check_notify(Entry), State} end,
[Notifs] =
- snmp_conf:read_files(Dir, [{Gen, Filter, Check, "notify.conf"}]),
+ snmp_conf:read_files(Dir, [{FileName, Gen, Order, Check, Filter}]),
Notifs.
check_notify({Name, Tag, Type}) ->