diff options
author | Micael Karlberg <[email protected]> | 2012-03-20 10:54:59 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-03-20 10:54:59 +0100 |
commit | d25cb373c7046eeadce5fffe7ab8301d8c03d647 (patch) | |
tree | 7de1bec1cf7fe582ab5c66baa0513d732b24d2da /lib/snmp/src/agent/snmp_community_mib.erl | |
parent | 787ce33c1139233f8dfb90c4f1b6caeb3df7940a (diff) | |
parent | da92034283c1813d6d06feb39f064d7d8f76f951 (diff) | |
download | otp-d25cb373c7046eeadce5fffe7ab8301d8c03d647.tar.gz otp-d25cb373c7046eeadce5fffe7ab8301d8c03d647.tar.bz2 otp-d25cb373c7046eeadce5fffe7ab8301d8c03d647.zip |
Merge branch 'bmk/snmp/snmp422_integration/r15' into maint
Diffstat (limited to 'lib/snmp/src/agent/snmp_community_mib.erl')
-rw-r--r-- | lib/snmp/src/agent/snmp_community_mib.erl | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl index 77307aa7ad..d7d41aca31 100644 --- a/lib/snmp/src/agent/snmp_community_mib.erl +++ b/lib/snmp/src/agent/snmp_community_mib.erl @@ -28,6 +28,7 @@ -export([add_community/5, add_community/6, delete_community/1]). -export([check_community/1]). +-include("snmpa_internal.hrl"). -include("SNMP-COMMUNITY-MIB.hrl"). -include("SNMP-TARGET-MIB.hrl"). -include("SNMPv2-TC.hrl"). @@ -120,10 +121,17 @@ init_tabs(Comms) -> read_community_config_files(Dir) -> ?vdebug("read community config file",[]), - Gen = fun(_) -> ok end, - Filter = fun(Comms) -> Comms end, - Check = fun(Entry) -> check_community(Entry) end, - [Comms] = + FileName = "community.conf", + Gen = fun(D, Reason) -> + warning_msg("failed reading config file ~s" + "~n Config Dir: ~s" + "~n Reason: ~p", + [FileName, D, Reason]), + ok + end, + Filter = fun(Comms) -> Comms end, + Check = fun(Entry) -> check_community(Entry) end, + [Comms] = snmp_conf:read_files(Dir, [{Gen, Filter, Check, "community.conf"}]), Comms. @@ -601,5 +609,8 @@ set_sname(_) -> %% Keep it, if already set. error(Reason) -> throw({error, Reason}). +warning_msg(F, A) -> + ?snmpa_warning("[COMMUNITY-MIB]: " ++ F, A). + config_err(F, A) -> snmpa_error:config_err("[COMMUNITY-MIB]: " ++ F, A). |