#! /bin/sh # PCP QA Test No. 583 # $Revision: 1.13 $ # based on 519, caused pmie to dump core initially # also #698718 # # # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved. # # creator owner=kenmcd seq=`basename $0` . ./localconfig if [ $PCP_EOE_VER -eq 2000 \ -o \( $PCP_EOE_VER -ge 6500 -a $PCP_EOE_VER -le 6505 \) ] then echo "need pmie with reconnect & don't dump core fix" >$seq.notrun echo "$seq: [not run] `cat $seq.notrun`" exit 0 fi echo "QA output created by $seq" # get standard environment, filters and checks . ./common.product . ./common.filter . ./common.check _filter() { sed \ -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]/TIMESTAMP/' \ -e 's/[A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/TIMESTAMP/' \ -e "s/`hostname -s` /HOST /" \ -e 's/[0-9][A-Z]:HOST/HOST/' \ -e 's/\(pmie[([]\)[0-9][0-9]*/\1PID/' } tmp=/tmp/$$ here=`pwd` sudo=$here/sudo status=1 # failure is the default! trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15 PMCD_CONNECT_TIMEOUT=60 PMCD_REQUEST_TIMEOUT=60 PMCD_RECONNECT_TIMEOUT=1,2 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT PMCD_RECONNECT_TIMEOUT SYSLOG='' for f in /var/adm/SYSLOG /var/log/messages do if [ -f $f ] then SYSLOG=$f break fi done if [ -z "$SYSLOG" ] then echo "Arrgh! Cannot find your syslog file" exit 1 fi # real QA test starts here $sudo rm -f core $sudo $PCP_RC_DIR/pcp stop sleep 3 eval `./getpmcdhosts -n 2 -L | sed -e 's/ / other2=/' -e 's/^/other1=/'` if [ -z "$other1" ] then echo "Error: cannot find first remote host running pmcd" exit fi if [ -z "$other2" ] then echo "Error: cannot find second remote host running pmcd" exit fi # note the following is time sensitive, run it too long # and we'll get extraneous output... cat <$tmp.in // use hosts not in QA circus // hosts = ":$other1 :$other2 :localhost"; some_host ( some_inst ( ( 100 * filesys.used \$hosts / filesys.capacity \$hosts ) > 0 ) ) -> print 5sec "full" " %h:[%i] %v% " & syslog 5sec "-p daemon.info" "PCP QA - please ignore - ..." " %h:[%i] %v% "; EOF rm -f $seq.full echo "=== pmie.conf ===" >$seq.full cat $tmp.in >>$seq.full pmie -t 1sec >$tmp.out 2>$tmp.err <$tmp.in & pmie_pid=$! sleep 5 $sudo $PCP_RC_DIR/pcp start | _filter_pcp_start _wait_for_pmcd _wait_for_pmlogger sleep 15 kill -INT $pmie_pid wait echo "pmie output ..." sed <$tmp.out \ -e "/ $other1:/d" \ -e "/ $other2:/d" \ -e '/ localhost:/d' grep " $other1:" <$tmp.out >/dev/null && echo "... at least one line for other1 host" grep " $other2:" <$tmp.out >/dev/null && echo "... at least one line for other2 host" grep ' localhost:' <$tmp.out >/dev/null && echo "... at least one line for localhost" echo echo "pmie stderr ..." _filter <$tmp.err echo >>$seq.full echo "=== pmie stdout ===" >>$seq.full cat $tmp.out >>$seq.full echo >>$seq.full echo "=== pmie stderr ===" >>$seq.full cat $tmp.err >>$seq.full echo echo "SYSLOG ..." $sudo tail -100 $SYSLOG \ | sed -n '/PCP QA - please ignore/s/\.\.\..*/.../p' \ | _filter \ | LC_COLLATE=POSIX sort -u echo >>$seq.full echo "=== tail SYSLOG ===" >>$seq.full $sudo tail -100 $SYSLOG >>$seq.full if [ -f core ] then echo echo "pmie dumped core!" file core else status=0 fi exit