3 # bogus pmda entries in pmcd.conf
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
17 if [ -z "$PCP_PMCDCONF_PATH" ] ; then
21 if [ -z "$PCP_PMCDLOG_PATH" ] ; then
24 status
=1 # failure is the default!
27 [ -z "$PCP_PMLOGGERCONTROL_PATH" ] && \
28 PCP_PMLOGGERCONTROL_PATH
="$PCP_SYSCONF_DIR/pmlogger/control"
29 PCP_PMDAROOT_LOG
="$PCP_LOG_DIR/pmcd/root.log"
31 $sudo rm -f $tmp.
* $seq.full
32 trap "_cleanup" 0 1 2 3 15
38 _restore_config
$PCP_PMCDCONF_PATH
39 _restore_config
$PCP_PMLOGGERCONTROL_PATH
41 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
44 # make sure bogus has gone away
46 echo "Anything below here may indicate that bogus has not gone away:"
47 grep bogus
$PCP_PMCDCONF_PATH
48 pminfo
-f pmcd.agent |
grep bogus
58 -e 's/^pmdaroot:/PMCD:/g' \
59 -e 's/^pmcd:/PMCD:/g' \
64 # real QA test starts here
66 # disable all pmloggers ...
67 _save_config
$PCP_PMLOGGERCONTROL_PATH
68 cat <<End-of-File >$tmp.tmp
69 # dummy file created by qa/$seq on `date`
70 # the goal here is to have a controlled primary logger that does
71 # not make requests to pmcd!
73 LOCALHOSTNAME y n $PCP_LOG_DIR/pmlogger/LOCALHOSTNAME -c /dev/null
75 $sudo cp $tmp.tmp
$PCP_PMLOGGERCONTROL_PATH
77 # backup $PCP_PMCDCONF_PATH
78 _save_config
$PCP_PMCDCONF_PATH
81 $PCP_AWK_PROG < $PCP_PMCDCONF_PATH > $tmp.pmcd.new
-v seq="$seq" -v path
="$tmp.bogus.pmda" '
84 printf("# Added by QA test %s\n", seq);
85 printf("bogus 169 pipe binary %s\n", path);
89 $1 == "[access]" { printline(); print; flag = 1; next }
91 END { if (flag == 0) printline(); }'
94 $sudo cp $tmp.pmcd.new
$PCP_PMCDCONF_PATH
97 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
100 echo == $PCP_PMCDCONF_PATH >> $seq.full
101 cat $PCP_PMCDCONF_PATH >> $seq.full
102 echo == $PCP_PMDAROOT_LOG >> $seq.full
103 cat $PCP_PMDAROOT_LOG >> $seq.full
104 echo == $PCP_PMCDLOG_PATH >> $seq.full
105 cat $PCP_PMCDLOG_PATH >> $seq.full
107 # check that pmcd reported the agent as an error
109 echo "errors for bogus in pmcd related log file(s):"
110 [ -f $PCP_PMDAROOT_LOG ] && \
111 egrep "^pmdaroot:" $PCP_PMDAROOT_LOG | _filter
112 egrep "^pmcd:" $PCP_PMCDLOG_PATH | _filter
114 # check that the pmcd.agent.status metric is correct
116 echo "pmcd agent metrics for bogus:"
117 pminfo
-f pmcd.agent.
type |
egrep '^pmcd|bogus'
118 pminfo
-f pmcd.agent.status |
egrep '^pmcd|bogus'