pmrep: update TODO, man page
[pcp.git] / qa / 519
blobc0803f6debe11bb201391d41072df38bf12e80ca
1 #! /bin/sh
2 # PCP QA Test No. 519
3 # exercise new action args (no limit of 2) for pmie ... caused
4 # pmie to dump core initially
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
9 # Solaris Note (OpenIndiana specifically)
11 # Need to edit /etc/syslog.conf and add these lines
12 # # for PCP QA
13 # daemon.info /var/log/syslog
15 # then kill -HUP <pid-for-syslogd>
18 seq=`basename $0`
19 echo "QA output created by $seq"
21 # get standard environment, filters and checks
22 . ./common.product
23 . ./common.filter
24 . ./common.check
26 rm -f $seq.out
27 case $PCP_PLATFORM
29 irix|linux)
30 ln $seq.$PCP_PLATFORM $seq.out || exit 1
31 SYSLOG_OPT='"-p daemon.info"'
33 darwin)
34 ln $seq.linux $seq.out || exit 1
35 SYSLOG_OPT=''
37 solaris)
38 ln $seq.linux $seq.out || exit 1
39 SYSLOG_OPT='"-p daemon.info"'
42 _notrun "Need qualified output for $PCP_PLATFORM"
44 esac
46 _filter()
48 # other syslog timestamp variants ...
49 # 2014-09-15T10:44:40.269104+10:00
50 sed \
51 -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/' \
52 -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/' \
53 -e 's/20[0-9][0-9]-[01][0-9]-[0-3][0-9]T[0-2][0-9]:[0-5][0-9]:[0-5][0-9]\.[0-9]*/TIMESTAMP/' \
54 -e 's/STAMP[-+][0-1][0-9]:[0-5][0-9]/STAMP/' \
55 -e "s/`hostname`/HOST/" \
56 -e "s/`hostname | sed -e 's/\..*//'`/HOST/" \
57 -e 's/[0-9][A-Z]:HOST/HOST/' \
58 -e 's/\(pmie[([]\)[0-9][0-9]*/\1PID/' \
59 -e 's/ \[ID [0-9][0-9]* daemon.info]//'
62 status=0 # success is the default!
63 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
65 PMCD_CONNECT_TIMEOUT=60
66 PMCD_REQUEST_TIMEOUT=60
67 export PMCD_CONNECT_TIMEOUT PMCD_REQUEST_TIMEOUT
69 eval `./getpmcdhosts -n 2 -L | sed -e 's/ / other2=/' -e 's/^/other1=/'`
70 if [ -z "$other1" ]
71 then
72 _notrun "Cannot find first remote host running pmcd"
74 if [ -z "$other2" ]
75 then
76 _notrun "Cannot find second remote host running pmcd"
77 exit
79 echo "other1=$other1" >>$here/$seq.full
80 echo "other2=$other2" >>$here/$seq.full
82 # real QA test starts here
83 $sudo rm -f core* $seq.core*
85 cat <<End-of-File | pmie -T 10sec >$tmp.out 2>$tmp.err
86 // use hosts not in QA circus
89 hosts = ":'$other1' :'$other2'";
91 some_host (
92 some_inst (
93 ( 100 * filesys.used \$hosts / filesys.capacity \$hosts ) > 0 ) )
94 -> shell 15 "src/show-args -c SYSMON -t PERF_INFO_SYSTEM -m 'file system over half-full" "\n%h:[%i] %v% " "'"
95 & syslog 15 $SYSLOG_OPT "PCP QA $seq - please ignore - ..." " %h:[%i] %v% ";
97 End-of-File
99 # hostnames $other1 and $other2 may contain domain name components,
100 # but pmie may just report the hostname
102 o1=`echo $other1 | sed -e 's/\..*//'`
103 o2=`echo $other2 | sed -e 's/\..*//'`
104 echo "pmie output ..."
105 sed <$tmp.out \
106 -e "/^$other1:/d" \
107 -e "/^$o1:/d" \
108 -e "/^$other2:/d" \
109 -e "/^$o2:/d" \
111 egrep "^($other1|$o1):" <$tmp.out >/dev/null && echo "... at least one line for other1 host"
112 egrep "^($other2|$o2)*:" <$tmp.out >/dev/null && echo "... at least one line for other2 host"
114 echo
115 echo "pmie stderr ..."
116 _filter <$tmp.err
118 # may be using journalctl, and so no syslog in the file system
120 if `which journalctl >/dev/null 2>&1`
121 then
122 echo "Using journalctl ..." >>$seq.full
123 have_journalctl=true
124 else
125 have_journalctl=false
126 SYSLOG=''
127 for f in /var/adm/SYSLOG /var/log/daemon.log /var/log/messages /var/log/syslog /var/log/system.log
129 if [ -f $f ]
130 then
131 SYSLOG=$f
132 break
134 done
135 if [ -z "$SYSLOG" ]
136 then
137 echo "Arrgh! Cannot find your syslog file"
138 exit 1
142 echo
143 echo "SYSLOG ..."
145 if $have_journalctl
146 then
147 # be careful ... --boot not supported in all versions, -l not
148 # supported in all versions
149 $sudo journalctl -b --full | tail -100 >$tmp.syslog
150 else
151 $sudo tail -100 $SYSLOG >$tmp.syslog
154 sed <$tmp.syslog -n '/PCP QA '"$seq"' - please ignore/s/\.\.\..*/.../p' \
155 | _filter \
156 | sort -u
158 echo >>$seq.full
159 if $have_journalctl
160 then
161 echo "=== tail journalctl -b --full ===" >>$seq.full
162 else
163 echo "=== tail SYSLOG ($SYSLOG) ===" >>$seq.full
165 echo "`wc -l <$tmp.syslog | sed -e 's/ //g'` lines ... expect 100" >>$seq.full
166 cat $tmp.syslog >>$seq.full
168 _check_core
170 exit