pmrep: update TODO, man page
[pcp.git] / qa / 992
blob7a133b9a1f42aa9bb96587e1ba422562b89a99ee
1 #!/bin/sh
2 # PCP QA Test No. 992
3 # test pmlogger with pmcpp integration
5 # Copyright (c) 2015 Ken McDonell. 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 status=1 # failure is the default!
17 $sudo rm -rf $tmp.* $seq.full
18 trap "cd $here; rm -rf $tmp.*; exit \$status" 0 1 2 3 15
20 # handle these ...
21 # /tmp/853-3145.*
22 # Dump optfetch structures from 0x7f56fa4bec30 next=0x7f56fa4bf3f0
23 # ...
24 # <empty line>
25 # 60.0.20 (kernel.all.cpu.user):
26 # 60.0.33 (hinv.ndisk):
27 # 60.0.25 (disk.all.write):
29 _filter()
31 sed \
32 -e "s@$tmp@TMP@g" \
33 -e "s@$PCP_BINADM_DIR@PCP_BINADM_DIR@g" \
34 -e "s@$PCP_VAR_DIR@PCP_VAR_DIR@g" \
35 -e '/(kernel\./s/[0-9.][0-9]*/PMID/' \
36 -e '/(hinv\./s/[0-9.][0-9]*/PMID/' \
37 -e '/(disk\./s/[0-9.][0-9]*/PMID/' \
38 | $PCP_AWK_PROG '
39 /^Dump optfetch structures/ { print "Dump optfetch structures ..."
40 skip = 1
41 next
43 skip == 1 && NF == 0 { skip = 0 }
44 skip == 0 { print }'
47 cat <<End-of-File >$tmp.config
48 # based on pmlogger(1) man page
49 log mandatory on once { hinv.ndisk }
50 log mandatory on every 10 minutes {
51 kernel.all.cpu.user # singular
52 sample.lights # indom
53 sample.long # non-terminal
54 sample.bin [ "bin-100" "bin-300" "bin-500" "bin-700" ] # instances
57 log mandatory on every 15 secs {
58 network.interface.out.packets [ "no-such-interface" ] # bad instance
60 log mandatory on every 15 secs {
61 foo.bar # bad metric
63 log mandatory on every 15 secs {
64 sample.string.write_me [ "?" ] # no instance for singular
67 %include "$tmp.macros.default"
69 %ifdef disk_all
70 log mandatory on %disk_all_freq {
71 %disk_all.write
73 log mandatory on %disk_all_freq {
74 %disk_all.read [ "nodisk" ]
76 %endif
77 End-of-File
79 # real QA test starts here
80 cat <<End-of-File >$tmp.macros.default
81 %undef disk_all
82 End-of-File
83 pmlogger -Dlog -C -c $tmp.config $tmp 2>&1 | _filter
85 echo
86 echo "=== now with disk_all defined ==="
87 cat <<End-of-File >$tmp.macros.default
88 %define disk_all disk.all
89 %define disk_all_freq 20sec
90 End-of-File
91 pmlogger -Dlog -C -c $tmp.config $tmp >$tmp.out 2>$tmp.err
92 echo "--- stdout ---" >>$here/$seq.full
93 cat $tmp.out >>$here/$seq.full
94 echo "--- stderr ---" >>$here/$seq.full
95 cat $tmp.err >>$here/$seq.full
96 cat $tmp.out $tmp.err | _filter
98 # success, all done
99 status=0
101 exit