Has anyone written anything to parse the snapmirror logs to convert:
dst Wed Mar 5 03:00:00 EST xxxxx:/vol/vol0/- yyyyy:/vol/vol1/xxxxx_vol0 Request (Scheduled) dst Wed Mar 5 03:00:04 EST xxxxx:/vol/vol0/- yyyyy:/vol/vol1/xxxxx_vol0 Start dst Wed Mar 5 03:51:58 EST xxxxx:/vol/vol0/- yyyyy:/vol/vol1/xxxxx_vol0 End (28215980 KB)
into something a bit more useful, like:
dst Wed Mar 5 03:51:58 EST bat07:/vol/vol0/- bat00bak:/vol/vol1/bat07_vol0 End (28215980 kB, 00:51:54, 530 MB/min)?
which adds elapsed time and transfer rate? Or, something further that completely parses the log and reports:
Source Size Elapsed Rate ------------------------------------------------------------------ xxxxx:/vol/vol0/- 28215980 kB 00:51:54 530 MB/min zzzzz:/vol/vol0/qtree 4345164 kB 00:16:13 262 MB/min [...]
for all my snapmirror transfers for the night?
Until next time...
The MathWorks, Inc. 508-647-7000 x7792 3 Apple Hill Drive, Natick, MA 01760-2098 508-647-7001 FAX tmerrill@mathworks.com http://www.mathworks.com ---
Todd,
On Wed, 5 Mar 2003, Todd C. Merrill wrote:
Has anyone written anything to parse the snapmirror logs to convert:
NetApp has provided a sample "SnapMirror Log Parser" script on the NOW site. I believe it does what you're looking for (or could be easily modified to do so). Just search for "parse_smlog" on NOW.
-Remington remi@netapp.com
No day but today.
On Wed, 5 Mar 2003, Todd C. Merrill wrote:
Has anyone written anything to parse the snapmirror logs to convert:
[...]
which adds elapsed time and transfer rate?
Thanks for the pointer! I further patched it to add the transfer rate I was looking for. Here's the diff file if anyone is interested (remove the ^M's from the original first and use `patch` to convert).
################################################################################ 667a668
my $duration = "";
669c670 < my $duration = get_duration_str($start_time, $time); ---
$duration = get_duration_str($start_time, $time);
673c674,685 < print " $event_data\n"; ---
if ($event_data =~ /Transfer Size: ((\d+) KB)/ ) { # calculate the rate my $size = $1; # in kB my ($time, $h, $m, $s); ($h,$m,$s) = split(/:/,$duration); $time = 60 * $h + $m + $s/60; # in minutes print " $event_data\t"; # to retain format: print the usual (above) and then append the rate printf("%s %9.3f %s", "Transfer rate:", ($size/1024)/$time, "MB/min\n"); } else { print " $event_data\n"; }
################################################################################
Output is now:
xxxxx:/vol/vol0/- => yyyyy:/vol/vol1/xxxxx_vol0 (Scheduled) transfer is completed. Start: Wed Mar 5 04:00:00 EST End: Wed Mar 5 04:42:36 EST Duration: 00:42:36 Transfer Size: (26374096 KB) Transfer rate: 604.600 MB/min
Wo-hoo!
Until next time...
The MathWorks, Inc. 508-647-7000 x7792 3 Apple Hill Drive, Natick, MA 01760-2098 508-647-7001 FAX tmerrill@mathworks.com http://www.mathworks.com ---