diff options
author | Micael Karlberg <[email protected]> | 2010-12-10 14:17:30 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2010-12-10 14:17:30 +0100 |
commit | 58620c2052e07490beb44a4bd1a8fbb5ebc028ac (patch) | |
tree | 4c7a84b2b78fe0ef25b37d511e6071c3be37c04f /lib/snmp/src | |
parent | d49bdb7c372c93d5b8007cbc016a587d91539fe9 (diff) | |
download | otp-58620c2052e07490beb44a4bd1a8fbb5ebc028ac.tar.gz otp-58620c2052e07490beb44a4bd1a8fbb5ebc028ac.tar.bz2 otp-58620c2052e07490beb44a4bd1a8fbb5ebc028ac.zip |
Various cosmetic (print) fixes. Wrong module names used for the
utility module in the test_config dir.
Diffstat (limited to 'lib/snmp/src')
-rw-r--r-- | lib/snmp/src/agent/snmp_community_mib.erl | 4 | ||||
-rw-r--r-- | lib/snmp/src/agent/snmpa.erl | 7 | ||||
-rw-r--r-- | lib/snmp/src/agent/snmpa_mib_lib.erl | 9 |
3 files changed, 14 insertions, 6 deletions
diff --git a/lib/snmp/src/agent/snmp_community_mib.erl b/lib/snmp/src/agent/snmp_community_mib.erl index 8f0f4cad73..5644a43345 100644 --- a/lib/snmp/src/agent/snmp_community_mib.erl +++ b/lib/snmp/src/agent/snmp_community_mib.erl @@ -336,6 +336,8 @@ get_target_addr_ext_mms(TDomain, TAddress, Key) -> get_target_addr_ext_mms(TDomain, TAddress, NextKey) end end. + + %%----------------------------------------------------------------- %% Instrumentation Functions %%----------------------------------------------------------------- @@ -347,7 +349,7 @@ snmpCommunityTable(print) -> PrintRow = fun(Prefix, Row) -> lists:flatten( - io_lib:format("~sIndex: ~p" + io_lib:format("~sIndex: ~p" "~n~sName: ~p" "~n~sSecurityName: ~p" "~n~sContextEngineID: ~p" diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index 8ad2a83de4..c09435c03b 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -326,6 +326,9 @@ print_mib_info() -> MibsInfo = mibs_info(), print_mib_info(MibsInfo). +print_mib_info([]) -> + io:format("~n", []), + ok; print_mib_info([{Mod, Tables, Variables} | MibsInfo]) -> io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), print_mib_variables2(Mod, Variables), @@ -379,9 +382,9 @@ make_pretty_mib(snmp_view_based_acm_mib) -> "SNMP-VIEW-BASED-ACM-MIB"; make_pretty_mib(snmp_target_mib) -> "SNMP-TARGET-MIB"; -make_pretty_mib(snmp_target_mib) -> +make_pretty_mib(snmp_community_mib) -> "SNMP-COMMUNITY-MIB"; -make_pretty_mib(snmp_target_mib) -> +make_pretty_mib(snmp_notification_mib) -> "SNMP-NOTIFICATION-MIB"; make_pretty_mib(snmp_target_mib) -> "SNMP-USER-BASED-SM-MIB"; diff --git a/lib/snmp/src/agent/snmpa_mib_lib.erl b/lib/snmp/src/agent/snmpa_mib_lib.erl index 22057b4547..700bdd1a6e 100644 --- a/lib/snmp/src/agent/snmpa_mib_lib.erl +++ b/lib/snmp/src/agent/snmpa_mib_lib.erl @@ -90,9 +90,9 @@ print_variables(Variables) when is_list(Variables) -> ok. print_variable(Variable, {value, Val}, Prefix) when is_atom(Variable) -> - io:format("~w~s => ~p~n", [Variable, Prefix, Val]); + io:format("~w~s=> ~p~n", [Variable, Prefix, Val]); print_variable(Variable, Error, Prefix) when is_atom(Variable) -> - io:format("~w~s => ERROR: ~p~n", [Variable, Prefix, Error]). + io:format("~w~s=> [e] ~p~n", [Variable, Prefix, Error]). print_variables_prefixify(Variables) -> MaxVarLength = print_variables_maxlength(Variables), @@ -139,10 +139,13 @@ print_table(Table, DB, FOI, PrintRow) -> print_table(Table, TableInfo, PrintRow). print_table(Table, TableInfo, PrintRow) when is_function(PrintRow, 2) -> - io:format("~w => ~n", [Table]), + io:format("~w =>", [Table]), do_print_table(TableInfo, PrintRow). +do_print_table({ok, [] = _TableInfo}, _PrintRow) -> + io:format(" -~n", []); do_print_table({ok, TableInfo}, PrintRow) when is_function(PrintRow, 2) -> + io:format("~n", []), lists:foreach(fun({RowIdx, Row}) -> io:format(" ~w => ~n~s~n", [RowIdx, PrintRow(" ", Row)]) |