docs: tweak formatting in pmrep(1) archive folio example
[pcp.git] / qa / 116
blob40fb105931f6c3fc861311c4b1e2b3cffa880399
1 #! /bin/sh
2 # PCP QA Test No. 116
3 # Check hyphen in host name
5 # Copyright (c) 2002 Silicon Graphics, Inc. All Rights Reserved.
8 seq=`basename $0`
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
12 . ./common.product
13 . ./common.filter
14 . ./common.check
16 . ./common.config
18 [ -z "$PCPQA_HYPHEN_HOST" -o "$PCPQA_HYPHEN_HOST" = "some-host" ] && \
19 _notrun 'PCPQA_HYPHEN_HOST is not set in ./common.config'
21 status=0 # success is the default!
22 $sudo rm -rf $tmp.*
23 rm -f $seq.full
24 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
26 # real QA test starts here
28 host=$PCPQA_HYPHEN_HOST
29 eval realhost=`pmprobe -v -h $PCPQA_HYPHEN_HOST pmcd.hostname | \
30 $PCP_AWK_PROG '{ print $3 }'`
31 if [ -z "$realhost" ]
32 then
33 _notrun "cannot connect to pmcd on $PCPQA_HYPHEN_HOST"
35 [ "$realhost" = Unknown ] && realhost=`pmhostname $PCPQA_HYPHEN_HOST`
37 _filter_pmlc()
39 sed \
40 -e '/primary/d' \
41 -e "s/$host/HYPHEN-HOST/" \
42 -e "s/$realhost/HYPHEN-HOST/" \
43 -e 's/HYPHEN-HOST\.localdomain/HYPHEN-HOST/' \
44 -e 's/ *.*/ .../'
47 _filter()
49 sed \
50 -e "s/$host/HYPHEN-HOST/" \
51 -e "s/$realhost/HYPHEN-HOST/" \
52 -e 's/HYPHEN-HOST\.localdomain/HYPHEN-HOST/' \
53 -e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/'
56 # real QA test starts here
58 echo "pmie [hostname in config]"
59 cat <<End-of-File >$tmp.config
60 delta = 1;
61 // note have to quote hostname
62 2 * pmcd.control.sighup :'$host' - pmcd.control.sighup :'$host';
63 End-of-File
64 cat $tmp.config >$seq.full
65 pmie -T 2sec -v <$tmp.config >$tmp.out 2>$tmp.err
66 cat $tmp.out $tmp.err \
67 | tee -a $seq.full \
68 | sed -e 's/expr_1: */expr_1: /' \
69 | _show_pmie_errors
71 echo
72 echo "pmval [metric spec on command line]"
73 pmval -t0.5 -s 1 $host:pmcd.control.sighup \
74 | tee -a $seq.full \
75 | _filter
77 echo
78 echo "pmlc [several uses]"
79 ( echo "show loggers"; \
80 echo "show loggers@$host"; \
81 echo "connect primary@$host"; \
82 echo "status" \
83 ) \
84 | pmlc -h $host -P \
85 | tee -a $seq.full \
86 | _filter_pmlc
88 # success, all done
89 status=0
90 exit