3 # pmlogger (assorted) and pmlc (PCP 2.0) version compatibility
4 # any host version ... see 374 for 64-bit host version
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
23 -e '/^pmlogger .* on host .* is logging metrics from host .*/d' \
25 -e '/^TIMESTAMP started/d' \
28 skip > 0 { skip--; next }
29 $1 == "log" && $2 == "size" { if ($3 > 100 && $3 <= 200) $3 = "more than 100"
30 else if ($3 > 200 && $3 <= 300) $3 = "more than 200"
41 cat <<end-of-file >$tmp.cmd
42 . \$PCP_DIR/etc/pcp.env
43 \$PCP_BINADM_DIR/pmsignal -s TERM $pid
45 \$PCP_BINADM_DIR/pmsignal -s KILL $pid
46 test -k \$PCP_TMP_DIR/pmlogger || sudo chmod o-w \$PCP_TMP_DIR/pmlogger
49 scp
-q $tmp.cmd pcpqa@
$host:$tmp.cmd
50 ssh -q pcpqa@
$host /bin
/sh
$tmp.cmd
>/dev
/null
2>&1
51 ssh -q pcpqa@
$host "rm -f $tmp.cmd"
59 cat <<'End-of-File' | ssh -q pcpqa@$host sh >$tmp.tmp 2>$tmp.err
60 if [ -r $PCP_DIR/etc/pcp.env ]
62 . $PCP_DIR/etc/pcp.env
64 echo "Error: unable to read $PCP_DIR/etc/pcp.env!" >&2
67 sudo rm -rf /tmp/$$ /tmp/$$.*
68 echo "log mandatory on once { hinv.ncpu }" >/tmp/$$.config
70 echo "[access]" >>/tmp/$$.config
71 echo "allow * : all;" >>/tmp/$$.config
72 test -k $PCP_TMP_DIR/pmlogger || sudo chmod o+w $PCP_TMP_DIR/pmlogger
73 ( pmlogger -L -c /tmp/$$.config -l /tmp/$$.log /tmp/$$ </dev/null >/dev/null 2>&1 ) &
78 echo "stdout from ssh to $host ..." >>$seq.full
79 cat $tmp.tmp
>>$seq.full
81 echo "stderr from ssh to $host ..." >>$seq.full
82 cat $tmp.err
>>$seq.full
88 echo "Arrgh ... failed to get remote pmlogger pid for host $host"
94 echo "Arrgh ... failed to get remote archive basename for host $host"
98 for i
in 1 2 3 4 5 6 7 8 9 10
100 ( echo ; echo "iteration $i" ) >>$seq.full
101 if echo quit | pmlc
-h $host $pid 2>&1 |
tee -a $seq.full |
grep 'Connected to' >/dev
/null
107 echo "Arrgh ... pmlogger (pid=$pid) on host $host failed to start after 20 seconds"
108 ssh -q pcpqa@
$host "ps | grep $pid"
109 ssh -q pcpqa@
$host "ls -l /tmp/$base.*"
110 ssh -q pcpqa@
$host "cat /tmp/$base.log"
119 cat <<End-of-File | pmlc 2>&1 | _filter
125 # singular, all instances
126 query { pmcd.simabi pmcd.control.register }
128 query pmcd.agent.type ["sample" "pmcd" "sampledso"]
132 log mandatory on once pmcd.agent.type ["sample" "pmcd"]
135 # stopping and starting again should be enough to allow pmlogger
136 # to have logged the metrics from the last request ... except the
137 # pmlc control port socket may not have been ripped down, so
142 echo "after first pmlc session ..." >>$seq.full
143 ssh -q pcpqa@
$host "ps | grep $pid" >>$seq.full
2>&1
144 ssh -q pcpqa@
$host "ls -l /tmp/$base.*" >>$seq.full
2>&1
145 ssh -q pcpqa@
$host "cat /tmp/$base.log" >>$seq.full
2>&1
147 cat <<End-of-File | pmlc 2>&1 | _filter
149 log mandatory off pmcd.agent.type ["sampledso"]
150 query pmcd.agent.type ["sample" "pmcd" "sampledso"]
153 echo "after second pmlc session ..." >>$seq.full
154 ssh -q pcpqa@
$host "ps | grep $pid" >>$seq.full
2>&1
155 ssh -q pcpqa@
$host "ls -l /tmp/$base.*" >>$seq.full
2>&1
156 ssh -q pcpqa@
$host "cat /tmp/$base.log" >>$seq.full
2>&1
160 # echo "log mandatory on once proc" | pmlc -h $host $pid -D1
161 echo "connect 0@$host" | pmlc
2>&1 | _filter
167 _remote_signal
$host $pid $base
177 if [ ! -z "$pid" -a ! -z "$base" -a ! -z "$host" ]
179 _remote_signal
$host $pid $base
189 status
=1 # failure is the default!
190 trap "_cleanup; exit \$status" 0 1 2 3 15
196 # the v1 host may be on the other side of the planet
198 PMCD_CONNECT_TIMEOUT
=30
199 PMCD_REQUEST_TIMEOUT
=30
200 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
202 # real QA test starts here
206 echo "=== pmlogger host type: $type ==="
207 host=`./getpmcdhosts -L -n 1 $type`
210 echo "./getpmcdhosts failed to find a suitable host" >$seq.notrun
213 echo "$type => $host" >>$seq.full
217 # output version depends on the PCP version at the _remote_ host
218 # not the local host as is normally the case
220 REMOTE_VER
=`pmprobe -v -h $host pmcd.version \
221 | sed -e 's/"$//' -e 's/.*"//' \
222 | $PCP_AWK_PROG -F. '{printf "%02d%02d%02d\n",$1,$2,$3}'`
223 echo "host=$host REMOTE_VER=$REMOTE_VER" >>$seq.full