stop-experiment 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/perl -w

use strict;

my $TEVC = "/usr/testbed/bin/tevc";
my $LOGHOLE = "/usr/testbed/bin/loghole";

#
# Require the pid and eid
#
if (@ARGV != 2) {
    die "Usage: $0 pid eid\n";
}

my ($pid, $eid) = @ARGV;

#
# Stop the stubs and monitors
#
print "##### Stopping stubs and monitors\n";
21 22 23 24 25 26 27
if (system "$TEVC -e $pid/$eid now plabstubs stop") {
    die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now planetstubs stop") {
    die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now monitorgroup stop") {
28 29 30 31 32 33
    die "Error running tevc\n";
}

#
# Stop link tracing
#
34
print "##### Stopping link tracing\n";
35 36 37 38 39 40
if (system "$TEVC -e $pid/$eid now planetc-tracemon snapshot") {
    die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now planetc-tracemon stop") {
    die "Error running tevc\n";
}
41 42 43 44 45 46 47 48 49 50 51 52
if (system "$TEVC -e $pid/$eid now plabc-tracemon snapshot") {
    die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now plabc-tracemon stop") {
    die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now elabc-tracemon snapshot") {
    die "Error running tevc\n";
}
if (system "$TEVC -e $pid/$eid now elabc-tracemon stop") {
    die "Error running tevc\n";
}
53

54 55 56 57 58 59 60 61
#
# Smack down host tcpdumps
#
print "##### Stopping host tcpdumps\n";
if (system "$TEVC -e $pid/$eid now tdhosts stop") {
    die "Error running tevc\n";
}

62 63 64 65 66 67 68 69
#
# Stop running servers
#
print "##### Stopping servers\n";
if (system "$TEVC -e $pid/$eid now allservers stop") {
    die "Error running tevc\n";
}

70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
#
# Grab logfiles
#
print "##### Gathering logfiles\n";
if (system "$LOGHOLE -e $pid/$eid sync") {
    die "Error running loghole\n";
}

#
# Create an archive containing these logfiles
#
print "##### Creating archive\n";
if (system "$LOGHOLE -e $pid/$eid archive") {
    die "Error running loghole\n";
}

print "##### Done\n";