/var/lib/pcp/testsuite/364 is in pcp-testsuite 4.0.1-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | #!/bin/sh
# PCP QA Test No. 364
# pmlogconf metric accessibility
#
# Copyright (c) 2010 Ken McDonell. All Rights Reserved.
#
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
# see if unix domain sockets are available (permissions)
_get_libpcp_config
target="-h localhost"
$unix_domain_sockets && target="-h unix:"
status=0 # success is the default!
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
_filter_solaris()
{
if [ $PCP_PLATFORM != solaris ]
then
cat
else
sed \
-e '/^disk.dev.avactive .* Unknown metric name/d' \
-e '/^network.icmp.* Unknown metric name/d' \
-e '/^network.igmp.* Unknown metric name/d' \
-e '/^network.ip.* Unknown metric name/d' \
-e '/^network.tcp.* Unknown metric name/d' \
-e '/^network.udp.* Unknown metric name/d' \
-e '/^filesys.* Unknown metric name/d' \
-e '/^swap .* Unknown metric name/d' \
-e '/^swap.pages.* Unknown metric name/d' \
-e '/^swapdev .* Unknown metric name/d' \
# solaris
fi
}
_filter_darwin()
{
if [ $PCP_PLATFORM != darwin ]
then
cat
else
sed \
-e '/^disk\.dev\.avactive .* Unknown metric name/d' \
-e '/^disk\.all\.avactive .* Unknown metric name/d' \
-e '/^disk\.partitions\..* Unknown metric name/d' \
-e '/^hinv\.nnode .* Unknown metric name/d' \
-e '/^network\.icmp .* Unknown metric name/d' \
-e '/^network\.igmp .* Unknown metric name/d' \
-e '/^network\.ip .* Unknown metric name/d' \
-e '/^network\.tcp .* Unknown metric name/d' \
-e '/^network\.udp .* Unknown metric name/d' \
-e '/^network\.udplite .* Unknown metric name/d' \
-e '/^swap .* Unknown metric name/d' \
-e '/^swap\..* .* Unknown metric name/d' \
-e '/^swapdev .* Unknown metric name/d' \
-e '/^proc\..* Unknown metric name/d' \
-e '/^kernel\.all\.intr .* Unknown metric name/d' \
-e '/^kernel\.all\.nusers .* Unknown metric name/d' \
-e '/^kernel\.all\.pswitch .* Unknown metric name/d' \
-e '/^mem\.util\.bufmem .* Unknown metric name/d' \
-e '/^mem\.util\.cached .* Unknown metric name/d' \
# darwin
fi
}
_filter_linux()
{
# pcp-atop uses metrics not supported on some kernels
if [ $PCP_PLATFORM != linux ]
then
cat
else
sed \
-e '/^network.softnet.* Metric not supported/d' \
-e '/^proc.namespaces.* Metric not supported/d' \
-e '/^proc.psinfo.cgroups.* No data available/d' \
-e '/^cgroup..*.container.* No data available/d' \
-e '/^proc.id.container.* No data available/d' \
# linux
fi
}
# remove all known platform-dependencies from output
# (ideally leaving any genuine failures behind)
#
_filter()
{
# these are always-on in older oss versions of pcp
sed \
-e '/^disk.dev.avg_disk.active .* metric name/d' \
-e '/^disk.all.avg_disk.active .* metric name/d' \
-e '/^disk.dev.bytes .* Unknown metric name/d' \
-e '/^disk.all.bytes .* Unknown metric name/d' \
-e '/^network.igmp .* Unknown metric name/d' \
-e '/^nfs.* Unknown metric name/d' \
-e '/^rpc.* Unknown metric name/d' \
-e '/^nfsclient.* Unknown metric name/d' \
-e '/^elasticsearch.search.all.* Metric not supported/d' \
-e '/^oracle.* Information not currently available/d' \
-e '/^swap.in .* Metric not supported/d' \
-e '/^swap.out .* Metric not supported/d' \
| _filter_linux | _filter_solaris | _filter_darwin
}
# real QA test starts here
pmlogconf $tmp.conf >$tmp.out 2>&1
cat $tmp.out >$seq.full
sed -e 's/:n:/:y:/' <$tmp.conf >$tmp.tmp
mv $tmp.tmp $tmp.conf
yes '' | pmlogconf $tmp.conf >$tmp.out
( echo && echo "== TMP.OUT" ) >>$seq.full
cat $tmp.out >>$seq.full
( echo && echo "== TMP.CONF") >>$seq.full
cat $tmp.conf >>$seq.full
( echo && echo "== FILTERED") >>$seq.full
sed -n <$tmp.conf \
-e '/^[ ]/{
s/^[ ]*//
s/[ ].*//
/^#/d
p
}' \
| LC_COLLATE=POSIX sort \
| uniq \
| tee -a $seq.full \
| xargs pmprobe $target \
| _filter \
| $PCP_AWK_PROG '
$2 >= 0 { next }
{ print }'
echo Silence is golden
# success, all done
exit
|