From 9401854175279040d3138b474226ceb4596f4aab Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Mon, 6 Dec 2010 18:38:10 +0100 Subject: Segmenting the printout using the mib names. --- lib/snmp/src/agent/snmpa.erl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'lib/snmp/src') diff --git a/lib/snmp/src/agent/snmpa.erl b/lib/snmp/src/agent/snmpa.erl index ce208d870b..ca6c02aabc 100644 --- a/lib/snmp/src/agent/snmpa.erl +++ b/lib/snmp/src/agent/snmpa.erl @@ -296,12 +296,24 @@ print_tables() -> print_tables([]) -> ok; -print_tables([{Mod, Tables}|MibTables]) -> - [(catch Mod:Table(print)) || Table <- Tables], +print_tables([{Mod, Tables}|MibTables]) when is_atom(Mod) andalso is_list(Tables) -> + print_tables(Mod, Tables), print_tables(MibTables); print_tables([_|MibTables]) -> print_tables(MibTables). +print_tables(Mod, Tables) -> + io:format("~n** ~s ** ~n~n", [make_pretty_mib(Mod)]), + [(catch Mod:Table(print)) || Table <- Tables]. + + +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(Mod) -> + atom_to_list(Mod). + %% - -- cgit v1.2.3