3 # Exercise the Apache PMDA Install/Remove, as well as the
4 # mechanism by which a PMDA can be installed with no pmcd
7 # Copyright (c) 2014-2015 Red Hat.
11 echo "QA output created by $seq"
13 # get standard environment, filters and checks
18 [ -f $PCP_PMDAS_DIR/apache
/pmdaapache
] || _notrun
"apache pmda not installed"
20 status
=1 # failure is the default!
21 $sudo rm -rf $tmp.
* $seq.full
25 # cull message resulting from no running httpd
26 grep -v 'Information not currently available'
32 echo "=== remove apache agent ==="
33 $sudo .
/Remove
>$tmp.out
2>&1
34 _filter_pmda_remove
<$tmp.out
39 # start from known starting points
40 cd $PCP_PMDAS_DIR/apache
41 $sudo .
/Remove
>/dev
/null
2>&1
42 $sudo $PCP_RC_DIR/pmcd stop
2>&1 | _filter_pcp_stop
45 echo "=== apache agent installation ==="
46 $sudo .
/Install
</dev
/null
>$tmp.out
2>&1
47 cat $tmp.out
>>$here/$seq.full
48 # Check apache metrics have appeared ... X metrics and Y values
49 _filter_pmda_install
<$tmp.out \
51 -e '/^Waiting for pmcd/s/\.\.\.[. ]*$/DOTS/' \
52 -e 's/[0-9][0-9]* warnings, //' \
54 /Check apache metrics have appeared/ { if ($7 >= 20 && $7 <= 80) $7 = "X"
55 if ($10 >= 0 && $10 <= 80) $10 = "Y"
61 trap "_cleanup_pmda apache; exit \$status" 0 1 2 3 15
63 # real QA test starts here
66 # there may be a race if the pmda has a bit of a slow start ... pause
70 # pmcd should have been started by the Install process - check
71 if pminfo
-v apache
> $tmp.info
2> $tmp.err
75 echo "... failed! ... here is the Install log ..."
78 cat $tmp.info
$tmp.err | _filter_apache