Import TBBT (NFS trace replay).
[bluesky.git] / TBBT / trace_play / sfs_ext_mon
1 #!/bin/sh
2 #       @(#)sfs_ext_mon 2.1     97/10/23
3 #
4 # This sample shell script can be used to start and stop
5 # external processes at the beginning and ending of the
6 # sfs load generation period respectively. The name of
7 # this program is pased in via the PRIME_MON_SCRIPT variable
8 # in the sfs_rc or equivalent file. The sfs_prime program
9 # executes this shell script just before it issues the START
10 # message to all the clients ie. "script_name START"; and likewise
11 # another call after all the clients have completed load generation ie.
12 # "script_name DONE".
13 #
14 # All environment variables exported from sfs_mgr are available for use.
15 #
16 EXT_MON_ARG=""
17 if [ $# -gt 1 ]
18 then
19     EXT_MON_ARG="$2"
20 fi
21
22 #
23 #----------------- START section -----------------
24 # Code section that handles starting of external processes.
25 # ALL PROCESSES SHOULD BE STARTED IN THE BACKGROUND OR ELSE
26 # THE TEST WILL BLOCK WAITING FOR THEIR COMPLETION!!
27 #
28 if [ "$1" = "START" ]; then
29         #
30         # place commands to start performance monitoring utilities as
31         # background processes here.
32         #
33         echo "$0: started external monitoring utilities" >&2
34         exit 0
35 fi
36
37 #
38 #----------------- DONE section -----------------
39 # Code section that handles stopping of external processes.
40 # ALL PROCESSES SHOULD BE STARTED IN THE BACKGROUND OR ELSE
41 # THE TEST WILL BLOCK WAITING FOR THEIR COMPLETION!!
42 #
43 if [ "$1" = "DONE" ]; then
44         #
45         # place commands to stop performance monitoring utilities as
46         # background processes here.
47         #
48         echo "$0: stopped external monitoring utilities" >&2
49         exit 0
50 fi
51
52 #
53 #----------------- ERROR section -----------------
54 # ERROR: BAD PARAMETER
55 #
56 echo "$0: bad param. " >&2
57 echo "usage: $0 START | DONE " >&2
58 exit 1