3 # verify the pmcd.pmie metrics from the pmcd PMDA
5 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 echo "QA output created by $seq"
11 # get standard environment, filters and checks
20 $sudo rm -f $PCP_TMP_DIR/pmie
/$pid3
26 $sudo rm -f $PCP_TMP_DIR/pmie
/$pid4
32 signal
=$PCP_BINADM_DIR/pmsignal
33 status
=1 # failure is the default!
34 trap "_cleanup; $sudo rm -f $tmp.*; exit \$status" 0 1 2 3 15
42 -e "s,/var$tmp,TMP,g" \
44 -e "s;/privateTMP;TMP;g" \
46 -e "s/`hostname`/HOST/g" \
47 -e "s/localhost\.localdomain/MYHOST/g" \
48 -e "s/localhost/HOST/g" \
49 -e "s/local:/HOST/g" \
51 NR == 1 { big = $1; next }
58 # real qa test starts here
60 echo === checking unknown
, numrules
, actions
, expected
, true
61 cat <<End-of-File >$tmp.conf
64 all_sample ( sample.long.ten @0..3 < 10 ) -> print "rule1: (BAD)" " %v < 10";
65 all_sample ( sample.long.ten @0..3 >= 10 ) -> print "rule2: (OK)" " %v >= 10";
66 sample.long.ten < 10 -> print "rule3: (BAD)" " %v < 10";
67 sample.long.ten >= 10 -> print "rule4: (OK)" " %v >= 10";
71 id pcp
>/dev
/null
2>&1 && __user
=pcp
75 cat >$tmp.cmd1
<<End-of-File
81 $sudo -u $__user sh
$tmp.cmd1 $@
$tmp.conf
>$tmp.pid
87 cat >$tmp.cmd2
<<End-of-File
93 $sudo -u $__user sh
$tmp.cmd2 $@
>$tmp.pid
98 _start_up_pmie1
-t 1sec
-T 4sec
$pmieopts -l $tmp.out1
100 _start_up_pmie2
-t 1sec
-T 4sec
$pmieopts -l $tmp.out2
102 echo "self=$$ pid1=$pid1 and pid2=$pid2" >> $seq.full
106 # link the pmie mmap'd files so they persist after the pmie processes
113 $sudo ln $PCP_TMP_DIR/pmie
/$pid1 $PCP_TMP_DIR/pmie
/$pid3
114 $sudo ln $PCP_TMP_DIR/pmie
/$pid2 $PCP_TMP_DIR/pmie
/$pid4
116 echo "log mandatory on default { pmcd.pmie }" \
117 | pmlogger
-t 0.25sec
-T 5sec
$tmp
121 echo "log from pid=$pid1" >> $seq.full
122 cat $tmp.out1
>> $seq.full
123 echo "log from pid=$pid2" >> $seq.full
124 cat $tmp.out2
>> $seq.full
126 # values at the end of the run should be deterministic for these metrics...
127 # ... metrics are instantaneous, so 10 samples reported in 9 secs
130 # expected = 4 rule evaluations every 1 sec (4.0)
131 # configfile = "<stdin>" and /tmp/[PID].conf
140 for pid
in $pid3 $pid4
143 [ $pid = $pid3 ] && echo "first pmie instance ..."
144 [ $pid = $pid4 ] && echo "second pmie instance ..."
145 echo "pid=$pid ..." >>$seq.full
147 for metric
in configfile logfile pmcd_host numrules actions \
148 eval.true
eval.false
eval.unknown
eval.expected
eval.actual
150 $PCP_ECHO_PROG $PCP_ECHO_N "$metric ""$PCP_ECHO_C"
151 echo "$metric ..." >>$seq.full
152 pmdumplog
$tmp pmcd.pmie.
$metric \