diff options
author | Raimo Niskanen <[email protected]> | 2014-05-21 14:33:50 +0200 |
---|---|---|
committer | Raimo Niskanen <[email protected]> | 2014-07-25 12:15:16 +0200 |
commit | e3f49c557c2cf0f4e98bbe538af4142167bac6ad (patch) | |
tree | 96fa44180a6ea625f6dd244ebd4fa9ef44332dc6 /lib/snmp/src/misc/snmp_config.erl | |
parent | cc1ab998ce905cd673c7ea14ee4e31ddb2412350 (diff) | |
download | otp-e3f49c557c2cf0f4e98bbe538af4142167bac6ad.tar.gz otp-e3f49c557c2cf0f4e98bbe538af4142167bac6ad.tar.bz2 otp-e3f49c557c2cf0f4e98bbe538af4142167bac6ad.zip |
Rewrite string representation of addresses and stop printing an error report when snmpa_net_if gets externally killed
Diffstat (limited to 'lib/snmp/src/misc/snmp_config.erl')
-rw-r--r-- | lib/snmp/src/misc/snmp_config.erl | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/snmp/src/misc/snmp_config.erl b/lib/snmp/src/misc/snmp_config.erl index 6d0f14237e..ac2b7b7778 100644 --- a/lib/snmp/src/misc/snmp_config.erl +++ b/lib/snmp/src/misc/snmp_config.erl @@ -1825,18 +1825,23 @@ write_agent_snmp_target_addr_conf( "%%\n\n", Hdr = header() ++ Comment, F = fun(v1 = Vsn, Acc) -> - [{mk_name(Addr, Vsn), Domain, Addr, Timeout, RetryCount, + [{mk_name(Domain, Addr, Vsn), + Domain, Addr, Timeout, RetryCount, "std_trap", mk_param(Vsn), "", [], 2048}| Acc]; (v2 = Vsn, Acc) -> - [{mk_name(Addr, Vsn), Domain, Addr, Timeout, RetryCount, + [{mk_name(Domain, Addr, Vsn), + Domain, Addr, Timeout, RetryCount, "std_trap", mk_param(Vsn), "", [], 2048}, - {lists:flatten(io_lib:format("~s.2",[mk_name(Addr, Vsn)])), + {lists:flatten( + io_lib:format("~s.2",[mk_name(Domain, Addr, Vsn)])), Domain, Addr, Timeout, RetryCount, "std_inform", mk_param(Vsn), "", [], 2048}| Acc]; (v3 = Vsn, Acc) -> - [{mk_name(Addr, Vsn), Domain, Addr, Timeout, RetryCount, + [{mk_name(Domain, Addr, Vsn), + Domain, Addr, Timeout, RetryCount, "std_trap", mk_param(Vsn), "", [], 2048}, - {lists:flatten(io_lib:format("~s.3",[mk_name(Addr, Vsn)])), + {lists:flatten( + io_lib:format("~s.3",[mk_name(Domain, Addr, Vsn)])), Domain, Addr, Timeout, RetryCount, "std_inform", mk_param(Vsn), "mgrEngine", [], 2048}| Acc] end, @@ -1852,10 +1857,10 @@ write_agent_snmp_target_addr_conf( mk_param(Vsn) -> lists:flatten(io_lib:format("target_~w", [Vsn])). -mk_name({[A,B,C,D], _}, Vsn) -> - lists:flatten(io_lib:format("~w.~w.~w.~w ~w", [A,B,C,D,Vsn])); -mk_name(Address, Vsn) -> - lists:flatten(io_lib:format("~w ~w", [Address,Vsn])). +mk_name(Domain, Addr, Vsn) -> + lists:flatten( + io_lib:format( + "~s ~w", [snmp_conf:mk_addr_string({Domain, Addr}), Vsn])). write_agent_target_addr_config(Dir, Hdr, Conf) -> snmpa_conf:write_target_addr_config(Dir, Hdr, Conf). |