3 # pmlogger_check and pmlogger_daily with shell components in the dir field
6 # Copyright (c) 2015 Ken McDonell. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard environment, filters and checks
17 status
=1 # failure is the default!
18 $sudo rm -rf $tmp.
* $seq.full
19 trap "cd $here; rm -rf $tmp.*; _cleanup; exit \$status" 0 1 2 3 15
20 signal
=$PCP_BINADM_DIR/pmsignal
25 -e 's/\.\.\.*/[dots]/' \
26 -e "s/$FULLLOCALHOST/LOCALHOST/g" \
27 -e "s/$LOCALHOST/LOCALHOST/g" \
28 -e "s/localhost/LOCALHOST/g" \
29 -e "s/local:/LOCALHOST/g" \
30 -e 's/control:[0-9][0-9]*]/control:LINE]/' \
31 -e 's;/usr/var;/var;g' \
34 -e '/Roll [^ ]*\/NOTICES /d' \
35 -e '/Start new [^ ]*\/NOTICES$/d' \
36 -e '/Restarting/s/process [0-9][0-9]*/process PID/' \
37 -e '/Looking for pmlogger/s/process [0-9][0-9]*/process PID/' \
38 -e '/Terminating pmlogger/s/process [0-9][0-9]*/process PID/' \
41 s/from host .*/from host .../
43 -e '/Latest folio created/s/ [0-9][0-9][0-9][0-9][01][0-9][0-3][0-9]\.[0-5][0-9]\.[0-5][0-9]/ DATE.TIME/' \
44 -e '/^pmlogger -m/s/ [0-9][0-9][0-9][0-9][01][0-9][0-3][0-9]\.[0-5][0-9]\.[0-5][0-9]/ DATE.TIME/' \
45 -e '/^pcp /s/ .*/ .../' \
46 -e '/^PMCD host /s/host .*/host .../' \
47 -e '/^log started /s/started .*/started .../' \
48 -e '/^last log entry /s/entry .*/entry .../' \
49 -e '/^current time /s/time .*/time .../' \
50 -e '/^log size /s/size .*/size .../' \
51 | _filter_cron_scripts
56 $sudo $signal -a -s TERM pmlogger
64 _stop_loggers
>/dev
/null
2>&1
66 cd # get out of tmp directory so we can delete it
69 $sudo $PCP_BINADM_DIR/pmlogger_check
75 _stop_loggers
>/dev
/null
2>&1
83 cat >$tmp.config
<<End-of-File
84 log mandatory on 1 sec {
90 # real QA test starts here
96 cat >$tmp/control
<<End-of-File
100 # $qatmp from the caller's environment
101 # $A from the control file above
102 LOCALHOSTNAME n n \$qatmp/\$A -c $tmp.config
103 LOCALHOSTNAME n n \$(echo $qatmp/B) -c $tmp.config
104 LOCALHOSTNAME n n "$qatmp/\`echo c | tr '[a-z]' '[A-Z]'\`" -c $tmp.config
107 echo "pmlogger_check #1" |
tee -a $here/$seq.full
108 $sudo $PCP_BINADM_DIR/pmlogger_check
-V -c $tmp/control
-l $tmp/log
109 [ -s $tmp/log
] && $sudo cat $tmp/log |
tee -a $here/$seq.full | _filter
112 ls $tmp/$x >>$here/$seq.full
113 echo `ls $tmp/$x | grep "\.meta" | wc -l | sed -e 's/ //g'` archives
in TMP
/$x
117 _stop_loggers
>/dev
/null
2>&1
119 echo "pmlogger_check #2" |
tee -a $here/$seq.full
120 $sudo $PCP_BINADM_DIR/pmlogger_check
-V -c $tmp/control
-l $tmp/log
121 [ -s $tmp/log
] && $sudo cat $tmp/log |
tee -a $here/$seq.full | _filter
124 ls $tmp/$x >>$here/$seq.full
125 echo `ls $tmp/$x | grep "\.meta" | wc -l | sed -e 's/ //g'` archives
in TMP
/$x
129 echo "pmlogger_daily"
130 $sudo $PCP_BINADM_DIR/pmlogger_daily
-V -c $tmp/control
-l $tmp/log
131 [ -s $tmp/log
] && $sudo cat $tmp/log |
tee -a $here/$seq.full | _filter
134 ls $tmp/$x >>$here/$seq.full
135 echo `ls $tmp/$x | grep "\.meta" | wc -l | sed -e 's/ //g'` archives
in TMP
/$x