File: 359

package info (click to toggle)
pcp 4.3.2%2Breally4.3.1-0.1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 175,188 kB
  • sloc: ansic: 261,305; sh: 123,606; xml: 107,279; cpp: 72,127; perl: 18,283; python: 15,453; yacc: 8,249; lex: 2,585; makefile: 1,957; fortran: 60; java: 52
file content (116 lines) | stat: -rwxr-xr-x 3,691 bytes parent folder | download
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
#!/bin/sh
# PCP QA Test No. 359
# Simple sanity check that we can get through validation of all
# of the metrics without any surprises
#
# 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

status=0	# success is the default!
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15

_filter()
{
    sed \
	-e '/No value(s) available/d' \
	-e '/Metric not supported by this version of monitored application/d' \
	-e '/cgroup\.groups: pmLookupName: Unknown metric name/d' \
	-e '/proc\.id\.container: No data available/d' \
	-e '/proc\.psinfo\.cgroups: No data available/d' \
	-e '/^sample\.needprofile:/d' \
	-e '/^sample\.bad\.unknown:/d' \
	-e '/^sample\.bad\.nosupport:/d' \
	-e '/^sample\.bad\.fetch\.again:/d' \
	-e '/^sampledso\.needprofile:/d' \
	-e '/^sampledso\.bad\.unknown:/d' \
	-e '/^sampledso\.bad\.nosupport:/d' \
	-e '/^sampledso\.bad\.fetch\.again:/d' \
	-e '/^proc\.schedstat.*: Unknown or .*/d' \
	-e '/^proc\.schedstat.*: No permission/d' \
	-e '/^proc\.psinfo.*: No permission/d' \
	-e '/^proc\.id\.container: Unknown or illegal instance identifier/d' \
	-e '/^proc\.psinfo\.cgroups: Unknown or illegal instance identifier/d' \
	-e '/^proc\.psinfo\.labels: Unknown or illegal instance identifier/d' \
	-e '/^proc\.memory.*: No permission/d' \
	-e '/^proc\.id.*: No permission/d' \
	-e '/^proc\.fd.*: No permission/d' \
	-e '/^proc\.io.*: /d' \
	-e '/^proc\.namespaces.*: /d' \
	-e '/^papi\..*: No permission/d' \
	-e '/^pipe\..*: Not Connected/d' \
	-e '/^prometheus: pmLookupDesc: Unknown or illegal metric identifier/d' \
	-e '/^libvirt\..*: Not Connected/d' \
	-e '/^postgresql\..*: Missing metric value(s)/d' \
	-e '/^logger\.perfile\.reg\.records: No permission/d' \
	-e '/^logger\.perfile\.fifo\.records: Try again./d' \
	-e '/^logger\.perfile\.reg\.records: Try again./d' \
	-e '/^redis\..*_avg_ttl: Try again./d' \
	-e '/^redis\..*_expires: Try again./d' \
	-e '/^redis\..*_keys: Try again./d' \
	-e '/^containers\..*: pmLookupDesc: Unknown or illegal metric/d' \
	-e '/^elasticsearch\..*: Try again./d' \
	-e '/^rsyslog\..*: Try again./d' \
	-e '/^libvirt\..*: Try again./d' \
	-e '/^apache\..*: Try again./d' \
	-e '/^oracle\..*: Try again./d' \
	-e '/^nginx\..*: Try again./d' \
	-e '/^zswap\..*: Try again./d' \
	-e '/Container not found/d' \
	-e '/^postgresql/d' \
    | if [ $PCP_PLATFORM = openbsd ]
    then
	sed \
	    -e '/^mem.util.anonpages: Not Supported/d' \
	# end
    else
	cat
    fi
}

_filter_libvirt()
{
    if _libvirt_is_ok
    then
	cat
    else
	# lines like ...
	# libvirt.dominfo.os.type: IPC protocol failure
	# libvirt.dominfo.os.type: pmLookupDesc: No PMCD agent for domain of request
	# libvirt: pmLookupDesc: Unknown or illegal metric identifier
	sed \
	    -e '/^libvirt\..*: IPC protocol failure/d' \
	    -e '/^libvirt\..*: No PMCD agent for domain/d' \
	    -e '/^libvirt.*: pmLookupDesc: Unknown or illegal metric/d' \
	# end
    fi
}

# if one of the PMDAs is broken or mis-installed the test will likely
# fail ... this might give a clue to help diagnosis
#
pcp >>$here/$seq.full 2>&1

# real QA test starts here

echo "First attempt ... expect nothing"
pminfo -v | _filter | _filter_libvirt
echo "Second attempt ... expect nothing"
pminfo -v | _filter | _filter_libvirt

echo "Once more, but with --container ... expect nothing"
containers=`pmprobe -v pmcd.feature.containers 2>/dev/null | awk '{ print $3 }'`
if [ "$containers" = "1" ]; then
    pminfo -v --container=no.such.container | _filter | _filter_libvirt
fi

# success, all done
exit