From f9f7bde8524e9863b689275691f4b4711e30d0ff Mon Sep 17 00:00:00 2001 From: Micael Karlberg Date: Wed, 22 Feb 2012 14:16:48 +0100 Subject: [snmp] Add log_to_io function for both manager and agent Add a log_to_io Audit Trail Log converter function for both the manager (snmpm) and agent (snmpa). Also fixed the converter functions in the logger module, snmp_log, which previously sometimes did not work properly (re-open an already open log with different properties). OTP-9940 --- lib/snmp/doc/src/notes.xml | 9 +++++++++ lib/snmp/doc/src/snmp.xml | 28 ++++++++++++++++++++++++++-- lib/snmp/doc/src/snmpa.xml | 34 +++++++++++++++++++++++++++++++++- lib/snmp/doc/src/snmpm.xml | 34 +++++++++++++++++++++++++++++++++- 4 files changed, 101 insertions(+), 4 deletions(-) (limited to 'lib/snmp/doc/src') diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml index 82c7deb467..e7fb4e2287 100644 --- a/lib/snmp/doc/src/notes.xml +++ b/lib/snmp/doc/src/notes.xml @@ -45,6 +45,15 @@ --> + +

Added the log_to_io audit-trail-log converter function to the + api modules of both the + manager + and + agent.

+

Own Id: OTP-9940

+
+

[manager] Introduced a new transport module, snmpm_net_if_mt, diff --git a/lib/snmp/doc/src/snmp.xml b/lib/snmp/doc/src/snmp.xml index af0833f005..3e6610891f 100644 --- a/lib/snmp/doc/src/snmp.xml +++ b/lib/snmp/doc/src/snmp.xml @@ -1,10 +1,10 @@ - +

- 19962009 + 19962012 Ericsson AB. All Rights Reserved. @@ -391,6 +391,30 @@ version of the protocol data unit. There is a new line between Vsn and PDU.

+ + + + + + log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + Convert an Audit Trail Log to text format + + LogDir = string() + Mibs = [MibName] + MibName = string() + LogName = string() + LogFile = string() + Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Reason = term() + + +

Converts an Audit Trail Log to a readable format and + prints it on stdio. See + log_to_txt + above for more info.

+
diff --git a/lib/snmp/doc/src/snmpa.xml b/lib/snmp/doc/src/snmpa.xml index 27d89ea4e3..9984a10fea 100644 --- a/lib/snmp/doc/src/snmpa.xml +++ b/lib/snmp/doc/src/snmpa.xml @@ -4,7 +4,7 @@
- 20042011 + 20042012 Ericsson AB. All Rights Reserved. @@ -495,6 +495,7 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} + log_to_txt(LogDir) log_to_txt(LogDir, Mibs) log_to_txt(LogDir, Mibs, OutFile) -> ok | {error, Reason} log_to_txt(LogDir, Mibs, OutFile, LogName) -> ok | {error, Reason} @@ -522,6 +523,37 @@ notification_delivery_info() = #snmpa_notification_delivery_info{} See snmp:log_to_txt for more info.

+ + +
+ + + log_to_io(LogDir) -> ok | {error, Reason} + log_to_io(LogDir, Mibs) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + Convert an Audit Trail Log to text format + + LogDir = string() + Mibs = [MibName] + MibName = string() + LogName = string() + LogFile = string() + Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Reason = disk_log_open_error() | file_open_error() | term() + disk_log_open_error() = {LogName, term()} + file_open_error() = {OutFile, term()} + + +

Converts an Audit Trail Log to a readable format and + prints it on stdio. + LogName defaults to "snmpa_log". + LogFile defaults to "snmpa.log". + See snmp:log_to_io + for more info.

+
diff --git a/lib/snmp/doc/src/snmpm.xml b/lib/snmp/doc/src/snmpm.xml index c36a1b2a24..9bbb6cdbdb 100644 --- a/lib/snmp/doc/src/snmpm.xml +++ b/lib/snmp/doc/src/snmpm.xml @@ -4,7 +4,7 @@
- 20042011 + 20042012 Ericsson AB. All Rights Reserved. @@ -1237,6 +1237,38 @@ priv_key = [integer()] (length is 16 if priv = usmDESPrivProtocol | usmAesCfb1 See snmp:log_to_txt for more info.

+ + + + + + log_to_io(LogDir) -> ok | {error, Reason} + log_to_io(LogDir, Mibs) -> ok | {error, Reason} + log_to_io(LogDir, Mibs) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start) -> ok | {error, Reason} + log_to_io(LogDir, Mibs, LogName, LogFile, Start, Stop) -> ok | {error, Reason} + Convert an Audit Trail Log to text format + + LogDir = string() + Mibs = [MibName] + MibName = string() + LogName = string() + LogFile = string() + Start = Stop = null | datetime() | {local_time,datetime()} | {universal_time,datetime()} + Reason = disk_log_open_error() | file_open_error() | term() + disk_log_open_error() = {LogName, term()} + file_open_error() = {OutFile, term()} + + +

Converts an Audit Trail Log to a readable format and + prints it on stdio. + LogName defaults to "snmpm_log". + LogFile defaults to "snmpm.log". + See snmp:log_to_io + for more info.

+
-- cgit v1.2.3