3 # Exercise $PMCD_PORT and $PMLOGGER_PORT mechanisms
5 # Copyright (c) 2014 Red Hat.
6 # Copyright (c) 1995-2002 Silicon Graphics, Inc. All Rights Reserved.
10 echo "QA output created by $seq"
12 # get standard filters
17 which netstat
>/dev
/null
2>&1 || _notrun
"netstat not installed"
22 ln $seq.out.ipv6
$seq.out ||
exit 1
24 ln $seq.out.nonipv6
$seq.out ||
exit 1
36 if [ -d $PCP_LOG_DIR/pmlogger
]
38 LOGGING_DIR
=$PCP_LOG_DIR/pmlogger
40 LOGGING_DIR
=$PCP_LOG_DIR
49 pmafm
$LOGGING_DIR/$LOCALHOST/Latest remove
>$tmp.cmd
2>&1 \
51 $sudo $PCP_RC_DIR/pcp restart | _filter_pcp_start
60 pmafm
$LOGGING_DIR/$LOCALHOST/Latest remove
>$tmp.cmd
2>&1 \
64 trap "_interrupt; _cleanup" 1 2 3 15
68 # real QA test starts here
71 export PMCD_PORT PMLOGGER_PORT
73 echo "pmcd with PMCD_PORT=$PMCD_PORT, pmlogger with PMLOGGER_PORT=$PMLOGGER_PORT"
74 # need to do this indirectly because system sudo cleanses the environment
76 echo "export PMCD_PORT=$PMCD_PORT" >$tmp.start
77 echo "export PMLOGGER_PORT=$PMLOGGER_PORT" >>$tmp.start
78 echo "$PCP_RC_DIR/pcp restart" >>$tmp.start
80 $sudo sh
$tmp.start | _filter_pcp_start
81 _wait_for_pmlogger
-P $LOGGING_DIR/$LOCALHOST/pmlogger.log
84 echo "pminfo with PMCD_PORT=$PMCD_PORT"
86 |
sed -e '/^pmcd\.pmie/d'
89 echo "pmlc with PMLOGGER_PORT=$PMLOGGER_PORT"
90 echo "show loggers" | pmlc \
92 -e '/primary/s/([0-9][0-9]*)/(LOGGER_PID) .../' \
93 -e "s/on `hostname`/on HOST/" \
94 -e "s/on local:/on HOST/" \
95 -e 's/ *[0-9][0-9]*//g'
98 echo 'port from $PCP_TMP_DIR/pmlogger/primary'
99 sed -e 1q
$PCP_TMP_DIR/pmlogger
/primary
101 # For Mac OS X need to massage lines like ..
102 # tcp4 0 0 *.42000 *.* LISTEN
103 # tcp6 0 0 *.42000 *.* LISTEN
105 echo "... and netstat"
108 |
sed -n -e '/4[23]000.*LISTEN/{
111 s/tcp4[ 0]*\*./inet./
112 s/tcp6[ 0]*\*./inet6./
114 s/.*\(inet6*.4[23]000\).*\(LISTEN\).*/... \1 ... \2/