From e38960550677e8ce26c442ad83bde28709df752c Mon Sep 17 00:00:00 2001 From: "Victor Grishchenko (mughal)" Date: Wed, 10 Feb 2010 20:06:05 +0100 Subject: [PATCH] Log harvesting scripts for the Manifold --- mfold/dohrv | 24 ++++++++++++++++++++++++ mfold/swlognm | 29 +++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100755 mfold/dohrv create mode 100755 mfold/swlognm 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; +} -- 2.20.1