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
26 -e '/^pmlogger .* on host .* is logging metrics from host .*/d' \
28 -e '/^TIMESTAMP started/d' \
31 skip > 0 { skip--; next }
32 $1 == "log" && $2 == "size" { if ($3 > 100 && $3 <= 200) $3 = "more than 100"
33 else if ($3 > 200 && $3 <= 300) $3 = "more than 200"
44 cat <<end-of-file >$tmp.cmd
45 . \$PCP_DIR/etc/pcp.env
46 \$PCP_BINADM_DIR/pmsignal -s TERM $pid
48 \$PCP_BINADM_DIR/pmsignal -s KILL $pid
49 test -k \$PCP_TMP_DIR/pmlogger || /usr/bin/sudo chmod o-w \$PCP_TMP_DIR/pmlogger 2>/dev/null
52 scp
-q $tmp.cmd pcpqa@
$host:$tmp.cmd
53 ssh -q pcpqa@
$host /bin
/sh
$tmp.cmd
>/dev
/null
2>&1
54 ssh -q pcpqa@
$host "rm -f $tmp.cmd"
62 cat <<'End-of-File' | ssh -q pcpqa@$host sh >$tmp.tmp 2>&1
63 if [ -r $PCP_DIR/etc/pcp.env ]
65 . $PCP_DIR/etc/pcp.env
67 echo "Error: unable to read $PCP_DIR/etc/pcp.env!" >&2
71 test -k $PCP_TMP_DIR/pmlogger || /usr/bin/sudo chmod o+w $PCP_TMP_DIR/pmlogger 2>/dev/null
72 ( pmlogger -T5min -L -c /dev/null -l /tmp/$$.log /tmp/$$ </dev/null >/dev/null 2>&1 ) &
77 echo "From ssh to $host ..." >>$seq.full
78 cat $tmp.tmp
>>$seq.full
84 echo "Arrgh ... failed to get remote pmlogger pid for host $host"
90 echo "Arrgh ... failed to get remote archive basename for host $host"
94 for i
in 1 2 3 4 5 6 7 8 9 10
96 if echo quit | pmlc
-h $host $pid 2>&1 |
grep 'Connected to' >/dev
/null
102 echo "Arrgh ... pmlogger (pid=$pid) on host $host failed to start after 20 seconds"
103 ssh -q pcpqa@
$host ps
-ef |
grep pmlogger
104 ssh -q pcpqa@
$host ls -l /tmp
/$base.
*
105 ssh -q pcpqa@
$host pmdumplog
-a /tmp
/$base
106 ssh -q pcpqa@
$host cat /tmp
/$base.log
116 cat <<End-of-File | pmlc 2>&1 | _filter
122 # singular, all instances
123 query { pmcd.simabi pmcd.control.register }
125 query pmcd.agent.type ["sample" "pmcd" "sampledso"]
129 log mandatory on once pmcd.agent.type ["sample" "pmcd"]
132 # stopping and starting again should be enough to allow pmlogger
133 # to have logged the metrics from the last request ... except the
134 # pmlc control port socket may not have been ripped down, so
139 cat <<End-of-File | pmlc 2>&1 | _filter
141 log mandatory off pmcd.agent.type ["sampledso"]
142 query pmcd.agent.type ["sample" "pmcd" "sampledso"]
147 # echo "log mandatory on once proc" | pmlc -h $host $pid -D1
148 echo "connect 0@$host" | pmlc
2>&1 | _filter
154 _remote_signal
$host $pid $base
164 if [ ! -z "$pid" -a ! -z "$base" -a ! -z "$host" ]
166 _remote_signal
$host $pid $base
176 status
=1 # failure is the default!
177 trap "_cleanup; exit \$status" 0 1 2 3 15
183 # the v1 host may be on the other side of the planet
185 PMCD_CONNECT_TIMEOUT
=30
186 PMCD_REQUEST_TIMEOUT
=30
187 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
189 # real QA test starts here
191 for type in '-b 64 -v pcp\>=2'
193 cmd
="./getpmcdhosts -L -n 1 $type 2>/dev/null"
197 echo "Cannot find a 64-bit host running PCP" >$seq.notrun
202 echo "=== pmlogger host type: $type ===" |
sed 's/\\>//'
203 echo "$type => $host" >>$seq.full