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"
30 trap "_cleanup" 0 1 2 3 15
36 _restore_config
$PCP_PMCDCONF_PATH
37 _restore_config
$PCP_PMLOGGERCONTROL_PATH
39 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
42 # make sure bogus has gone away
44 echo "Anything below here may indicate that bogus has not gone away:"
45 grep bogus
$PCP_PMCDCONF_PATH
46 pminfo
-f pmcd.agent |
grep bogus
52 # real QA test starts here
54 # disable all pmloggers ...
55 _save_config
$PCP_PMLOGGERCONTROL_PATH
56 cat <<End-of-File >$tmp.tmp
57 # dummy file created by qa/$seq on `date`
58 # the goal here is to have a controlled primary logger that does
59 # not make requests to pmcd!
61 LOCALHOSTNAME y n $PCP_LOG_DIR/pmlogger/LOCALHOSTNAME -c /dev/null
63 $sudo cp $tmp.tmp
$PCP_PMLOGGERCONTROL_PATH
65 # backup $PCP_PMCDCONF_PATH
66 _save_config
$PCP_PMCDCONF_PATH
69 $PCP_AWK_PROG < $PCP_PMCDCONF_PATH > $tmp.pmcd.new
-v seq="$seq" -v path
="$tmp.bogus.pmda" '
72 printf("# Added by QA test %s\n", seq);
73 printf("bogus 169 pipe binary %s\n", path);
77 $1 == "[access]" { printline(); print; flag = 1; next }
79 END { if (flag == 0) printline(); }'
82 $sudo cp $tmp.pmcd.new
$PCP_PMCDCONF_PATH
85 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
88 # check that pmcd reported the agent as an error
90 echo "errors for bogus in $PCP_PMCDLOG_PATH:" \
91 |
sed -e"s|$PCP_PMCDLOG_PATH|/var/adm/pcplog/pmcd.log|"
92 egrep "^pmcd:" $PCP_PMCDLOG_PATH \
96 # check that the pmcd.agent.status metric is correct
98 echo "pmcd agent metrics for bogus:"
99 pminfo
-f pmcd.agent.
type |
egrep '^pmcd|bogus'
100 pminfo
-f pmcd.agent.status |
egrep '^pmcd|bogus'