From: Victor Grishchenko (mughal) Date: Wed, 10 Feb 2010 19:06:05 +0000 (+0100) Subject: Log harvesting scripts for the Manifold X-Git-Url: http://p2p-next.cs.pub.ro/gitweb/?a=commitdiff_plain;h=e38960550677e8ce26c442ad83bde28709df752c;p=swift-upb.git Log harvesting scripts for the Manifold --- diff --git a/mfold/dohrv b/mfold/dohrv new file mode 100755 index 0000000..a61c878 --- /dev/null +++ b/mfold/dohrv @@ -0,0 +1,24 @@ +#!/bin/bash + +if [ ! $SERVERS ]; then + SERVERS="servers.txt" +fi + +rm -rf harvest +mkdir harvest + +for s in `cat $SERVERS`; do + (if ssh $s "cat ./swift/lout.gz" | gunzip | \ + perl -ne 's/(#\d+)/'$s' $1/ && print' \ + > harvest/$s.log ; then + echo $s harvest OK + else + echo $s harvest FAIL + fi) & +done + +wait +echo 'harvested all; sorting' +sort -m harvest/*.log | ./swlognm | gzip > harvest/swarm.log.gz + +echo DONE diff --git a/mfold/swlognm b/mfold/swlognm new file mode 100755 index 0000000..da42a29 --- /dev/null +++ b/mfold/swlognm @@ -0,0 +1,29 @@ +#!/usr/bin/perl -w + +# +# This script detects handshake patterns +# and changes channel numbers for host names +# +#0_05_01_981_298 node309 #45 +hs f33dff82 +#0_05_02_039_313 lossy #16 -hs f33dff82 +my %HSSRC = (); +my %CH = (); + +while (<>) { + / (\S+) (\#\d+)/ || next; + my $src = $1; + my $ch = $2; + if ( exists $CH{"$src$ch"} ){ + s/$ch/$CH{"$src$ch"}$ch/ or die $_; + } elsif (/[\+\-]hs ([a-f0-9]+)$/) { + if ( exists $HSSRC{$1} ) { + $CH{"$src$ch"} = $HSSRC{$1}; + my $srckey = $HSSRC{$1}.$HSSRCCH{$1}; + $CH{$srckey} = $src; + } else { + $HSSRC{$1} = $src; + $HSSRCCH{$1} = $ch; + } + } + print; +}