/var/lib/pcp/testsuite/213 is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | #! /bin/sh
# PCP QA Test No. 213
# exercise dbpmda with dynamic metrics
#
# Copyright (c) 2009 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
status=0 # success is the default!
username=`id -u -n`
$sudo rm -rf $tmp.* $seq.full
trap "_cleanup; exit \$status" 0 1 2 3 15
culldir=false
_cleanup()
{
$culldir && _restore_config "$PCP_TMP_DIR/mmv"
$sudo rm -f mmv.log
rm -f $tmp.*
}
# is a pre-existing mmv directory in place? if so, write access needed
if [ -d "$PCP_TMP_DIR/mmv" ]
then
_save_config "$PCP_TMP_DIR/mmv"
$sudo rm -rf $PCP_TMP_DIR/mmv
fi
culldir=true
$sudo mkdir -p -m 1777 "$PCP_TMP_DIR/mmv"
$sudo chown $PCP_USER:$PCP_GROUP "$PCP_TMP_DIR/mmv"
_filter()
{
tee -a $seq.full \
| sed \
-e "s;$PCP_PMDAS_DIR;\$PCP_PMDAS_DIR;" \
-e "s;$PCP_TMP_DIR;\$PCP_TMP_DIR;" \
-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/' \
-e 's/dbpmda([0-9][0-9]*)/dbpmda(PID)/' \
-e "s/ -U $username//g" \
-e "s/\.$DSO_SUFFIX/.DSO_SUFFIX/g" \
-e "s@$tmp@TMP@g" \
| _filter_dumpresult
}
pipeargs=""
id pcp >/dev/null 2>&1 && pipeargs="-U $username"
# real QA test starts here
echo "=== DSO PMDA test ==="
cat <<End-of-File | dbpmda -ei 2>&1 | _filter
open dso $PCP_PMDAS_DIR/sample/pmda_sample.$DSO_SUFFIX sample_init 30
name 30.0.1001
name 30.0.1007
name 2.4.1
pmid sampledso.secret.foo.two
pmid sampledso.secret.foo.bar.grunt.snort.six
pmid sampledso.secret.foo.bar.max.redirect
children sampledso.secret.foo
traverse sampledso.secret.foo
children sampledso.secret.foo.bar
traverse sampledso.secret.foo.bar
End-of-File
echo
echo "=== Daemon PMDA test ==="
cat <<End-of-File | dbpmda -ei 2>&1 | _filter
open pipe $PCP_PMDAS_DIR/sample/pmdasample $pipeargs 29 -l $tmp.log
name 29.0.1001
name 29.0.1007
name 2.4.1
pmid sample.secret.foo.two
pmid sample.secret.foo.bar.grunt.snort.six
pmid sample.secret.foo.bar.max.redirect
children sample.secret.foo
traverse sample.secret.foo
children sample.secret.foo.bar
traverse sample.secret.foo.bar
End-of-File
cat $tmp.log >>$here/$seq.full
echo
echo "=== MMV PMDA test ==="
src/mmv_genstats
echo "installed mmv files ..."
find $PCP_TMP_DIR/mmv -type f | sed -e "s;$PCP_TMP_DIR;PCP_TMP_DIR;"
cat <<End-of-File >$tmp.pmns
root {
mmv 70:*:*
}
End-of-File
cat <<End-of-File | dbpmda -ei -n $tmp.pmns 2>&1 | _filter
desc mmv.test.strings
fetch mmv.test.strings mmv.test.counter
text mmv.test.strings
store mmv.control.reload "1"
open pipe $PCP_PMDAS_DIR/mmv/pmdammv $pipeargs -l $tmp.log
desc mmv.test.strings
fetch mmv.test.strings mmv.test.counter
text mmv.test.strings
store mmv.control.reload "1"
desc mmv.no.such.metric
close
open dso $PCP_PMDAS_DIR/mmv/pmda_mmv.$DSO_SUFFIX mmv_init 70
desc mmv.test.strings
fetch mmv.test.strings mmv.test.counter
text mmv.test.strings
store mmv.control.reload "1"
End-of-File
cat $tmp.log >>$here/$seq.full
# success, all done
exit
|