3 # pmlogger (assorted) and pmlc (PCP 2.0) version compatibility
5 # 64-bit host version ... see 322 for 32-bit host version ... this
6 # one is optionally not run if you can't find a 64-bit host running
9 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
13 echo "QA output created by $seq"
15 # get standard filters
22 if [ $PCP_VER -lt 30800 ]
24 ln $seq.out
.1 $seq.out ||
exit 1
26 ln $seq.out
.2 $seq.out ||
exit 1
33 -e '/^pmlogger .* on host .* is logging metrics from host .*/d' \
35 -e '/^TIMESTAMP started/d' \
38 skip > 0 { skip--; next }
39 $1 == "log" && $2 == "size" { if ($3 > 100 && $3 <= 200) $3 = "more than 100"
40 else if ($3 > 200 && $3 <= 300) $3 = "more than 200"
51 cat <<end-of-file >$tmp.cmd
52 . \$PCP_DIR/etc/pcp.env
53 \$PCP_BINADM_DIR/pmsignal -s TERM $pid
55 \$PCP_BINADM_DIR/pmsignal -s KILL $pid
56 test -k \$PCP_TMP_DIR/pmlogger || /usr/bin/sudo chmod o-w \$PCP_TMP_DIR/pmlogger 2>/dev/null
59 scp
-q $tmp.cmd pcpqa@
$host:$tmp.cmd
60 ssh -q pcpqa@
$host /bin
/sh
$tmp.cmd
>/dev
/null
2>&1
61 ssh -q pcpqa@
$host "rm -f $tmp.cmd"
69 cat <<'End-of-File' | ssh -q pcpqa@$host sh >$tmp.tmp 2>&1
70 if [ -r $PCP_DIR/etc/pcp.env ]
72 . $PCP_DIR/etc/pcp.env
74 echo "Error: unable to read $PCP_DIR/etc/pcp.env!" >&2
78 test -k $PCP_TMP_DIR/pmlogger || /usr/bin/sudo chmod o+w $PCP_TMP_DIR/pmlogger 2>/dev/null
79 ( pmlogger -T5min -L -c /dev/null -l /tmp/$$.log /tmp/$$ </dev/null >/dev/null 2>&1 ) &
84 echo "From ssh to $host ..." >>$seq.full
85 cat $tmp.tmp
>>$seq.full
91 echo "Arrgh ... failed to get remote pmlogger pid for host $host"
97 echo "Arrgh ... failed to get remote archive basename for host $host"
101 for i
in 1 2 3 4 5 6 7 8 9 10
103 if echo quit | pmlc
-h $host $pid 2>&1 |
grep 'Connected to' >/dev
/null
109 echo "Arrgh ... pmlogger (pid=$pid) on host $host failed to start after 20 seconds"
118 cat <<End-of-File | pmlc 2>&1 | _filter
124 # singular, all instances
125 query { pmcd.simabi pmcd.control.register }
127 query pmcd.agent.type ["sample" "pmcd" "sampledso"]
131 log mandatory on once pmcd.agent.type ["sample" "pmcd"]
134 # stopping and starting again should be enough to allow pmlogger
135 # to have logged the metrics from the last request ... except the
136 # pmlc control port socket may not have been ripped down, so
141 cat <<End-of-File | pmlc 2>&1 | _filter
143 log mandatory off pmcd.agent.type ["sampledso"]
144 query pmcd.agent.type ["sample" "pmcd" "sampledso"]
149 # echo "log mandatory on once proc" | pmlc -h $host $pid -D1
150 echo "connect 0@$host" | pmlc
2>&1 | _filter
156 _remote_signal
$host $pid $base
166 if [ ! -z "$pid" -a ! -z "$base" -a ! -z "$host" ]
168 _remote_signal
$host $pid $base
178 status
=1 # failure is the default!
179 trap "_cleanup; exit \$status" 0 1 2 3 15
185 # the v1 host may be on the other side of the planet
187 PMCD_CONNECT_TIMEOUT
=30
188 PMCD_REQUEST_TIMEOUT
=30
189 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
191 # real QA test starts here
193 for type in '-b 64 -v pcp\>=2'
195 cmd
="./getpmcdhosts -L -n 1 $type 2>/dev/null"
199 echo "Cannot find a 64-bit host running PCP" >$seq.notrun
204 echo "=== pmlogger host type: $type ===" |
sed 's/\\>//'
205 echo "$type => $host" >>$seq.full