/var/lib/pcp/testsuite/366 is in pcp-testsuite 3.8.12ubuntu1.
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 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 | #!/bin/sh
# PCP QA Test No. 366
# pmlogconf - migrate from version 1.0 to 2.0
#
# Copyright (c) 2010 Ken McDonell. All Rights Reserved.
#
# Maintenance notes.
# As pmlogconf usage grows, the generated pmlogconf files are going
# to become more complicated and more variable across platforms and
# in particular groups will change from not being expanded by default
# to be expanded by default, and new groups will be added.
#
# Where this test _expects_ a control line to be expanded to a group
# of metrics, we use platform/version variants of the *.out files.
#
# But where a control line is expanded on some platforms, but not
# on others, we should just cull the control line from the $tmp.conf
# file and the block of related changes in all the *.out files ...
# as long as some expansion is done, the test remains valid.
#
# Newly added groups should be handled by adding to the $tmp.cull-list
# file below, using the pmlogconf "tag", e.g. networking/nfs2-client, and
# possibly removing the block of related changes in all the *.out files
seq=`basename $0`
echo "QA output created by $seq"
# get standard environment, filters and checks
. ./common.product
. ./common.filter
. ./common.check
. ./localconfig
[ -f $PCP_BINADM_DIR/pmlogconf-setup ] || _notrun "pmlogconf version 2.0 not installed"
_filter()
{
sed \
-e "s;$PCP_VAR_DIR;\$PCP_VAR_DIR;g" \
-e '/^[0-9]/d'
}
status=0 # success is the default!
$sudo rm -rf $tmp.* $seq.full
trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
cat <<End-of-File >$tmp.cull-list
networking/nfs2-client
networking/nfs2-server
networking/nfs3-client
networking/nfs3-server
networking/nfs4-client
networking/nfs4-server
tools/atop
tools/collectl
tools/mpstat
tools/vmstat
tools/iostat
tools/sar
shping/summary
postgresql/summary
sqlserver/summary
mysql/summary
memory/proc-linux
disk/perpartition
End-of-File
# turn $tmp.cull-list into an awk program to cull groups like
#+ networking/nfs2-client:n:default:
## NFS v2 client stats
#----
#
echo "BEGIN { i=0; skip=0" >$tmp.awk
sed -e 's/.*/ cull[i++] = "&"/' <$tmp.cull-list >>$tmp.awk
cat <<'End-of-File' >>$tmp.awk
}
$1 == "#+" { for (tag in cull) {
split($2, word, /:/)
if (word[1] == cull[tag]) {
skip = 1
next
}
}
skip = 0
}
skip == 0 { print }
End-of-File
cat <<'End-of-File' >$tmp.conf
#pmlogconf 1.0
# pmlogconf.sh control file version
#
# pmlogger(1) config file created and updated by
# pmlogconf.sh(1).
#
# DO NOT UPDATE THE INTITIAL SECTION OF THIS FILE.
# Any changes may be lost the next time pmlogconf.sh is used
# on this file.
#
# System configuration
#
#+ I0:n:once:
## hardware configuration [nodevis, osvis, oview, routervis,
## pmchart:Overview]
#----
# Disk activity
#
#+ D0:n:default:
## activity (IOPs and bytes for both reads and writes) over all disks
## [osvis, pmstat, pmchart:Disk, pmchart:Overview]
#----
#+ D1:n:default:
## per controller disk activity [pmchart:DiskCntrls]
#----
#+ D2:n:default:
## per spindle disk activity [dkvis, pmie:per_disk]
#----
#+ D3:n:default:
## all available data per disk spindle
#----
# CPU activity
#
#+ C0:n:default:
## utilization (usr, sys, idle, ...) over all CPUs [osvis, pmstat,
## pmchart:CPU, pmchart:Overview, pmie:cpu]
#----
#+ C2:n:default:
## contributions to CPU wait time
#----
#+ C1:n:default:
## utilization per CPU [clustervis, mpvis, nodevis, oview, pmie:cpu,
## pmie:per_cpu]
#----
#+ C3:n:default:
## per CPU contributions to wait time
#----
# Kernel activity
#
#+ K0:n:default:
## load average and number of logins [osvis, pmstat, pmchart:LoadAvg,
## pmchart:Overview, pmie:cpu]
#----
#+ Ka:n:default:
## run and swap queues [pmkstat]
#----
#+ K1:n:default:
## context switches, total syscalls and counts for selected calls (e.g. read,
## write, fork, exec, select) over all CPUs [pmstat, pmchart:Syscalls,
## pmie:cpu]
#----
#+ K2:n:default:
## per CPU context switches, total syscalls and counts for selected calls
## [pmie:per_cpu]
#----
#+ K3:n:default:
## bytes across the read() and write() syscall interfaces
#----
#+ K4:n:default:
## interrupts [pmkstat]
#----
#+ K5:n:default:
## buffer cache reads, writes, hits and misses [pmchart:BufferCache,
## pmie:filesys]
#----
#+ K6:n:default:
## all available buffer cache data
#----
#+ K7:n:default:
## vnode activity
#----
#+ K8:n:default:
## name cache (namei, iget, etc) activity [pmchart:DNLC, pmie:filesys]
#----
#+ K9:n:default:
## asynchronous I/O activity
#----
# Memory
#
#+ M0:n:default:
## pages in and out (severe VM demand) [pmstat, pmchart:Paging]
#----
#+ M1:n:default:
## address translation (faults and TLB activity)
#----
#+ M2:n:default:
## kernel memory allocation [osvis, pmstat, pmchart:Memory, pmchart:Overview]
#----
#+ M3:n:default:
## current swap allocation and all swap activity [pmchart:Swap, pmie:memory]
#----
#+ M4:n:default:
## swap configuration
#----
#+ M5:n:default:
## "large" page and Origin node-based allocations and activity [nodevis,
## oview]
#----
#+ M7:n:default:
## NUMA migration stats [nodevis, oview]
#----
#+ M6:n:default:
## all NUMA stats
#----
# Network
#
#+ N0:n:default:
## bytes and packets (in and out) and bandwidth per network interface
## [clustervis, osvis, pmchart:NetBytes, pmchart:Overview, pmie:per_netif]
#----
#+ N1:n:default:
## all available data per network interface
#----
#+ N2:n:default:
## TCP bytes and packets (in and out), connects, accepts, drops and closes
## [pmchart:NetConnDrop, pmchart:NetPackets, pmie:network]
#----
#+ N3:n:default:
## all available TCP data [pmchart:NetTCPCongestion]
#----
#+ N4:n:default:
## UDP packets in and out [pmchart:NetPackets]
#----
#+ N5:n:default:
## all available UDP data
#----
#+ N6:n:default:
## socket stats (counts by type and state)
#----
#+ N7:n:default:
## all available data for other protocols (IP, ICMP, IGMP)
#----
#+ N8:n:default:
## mbuf stats (alloc, failed, waited, etc) [pmie:network]
#----
#+ N9:n:default:
## multicast routing stats
#----
#+ Na:n:default:
## SVR5 streams activity
#----
# Services
#
#+ S2:n:default:
## RPC stats [pmie:rpc]
#----
# Filesystems and Volumes
#
#+ F0:n:default:
## Filesystem fullness [pmchart:FileSystem, pmie:filesys]
#----
#+ F1:n:default:
## XFS data and log traffic
#----
#+ F2:n:default:
## all available XFS data
#----
#+ F3:n:default:
## XLV operations and bytes per volume [xlv_vis]
#----
#+ F4:n:default:
## XLV striped volume stats [xlv_vis]
#----
#+ F6:n:default:
## XVM operations and bytes per volume
#----
#+ F7:n:default:
## XVM stripe, mirror and concat volume stats [pmie:xvm]
#----
#+ F8:n:default:
## all available XVM data
#----
#+ F5:n:default:
## EFS activity
#----
# Hardware event counters
#
#+ H0:n:default:
## NUMALink routers [nodevis, oview, routervis, pmchart:NUMALinks,
## pmie:craylink]
#----
#+ H1:n:default:
## Origin hubs [pmie:craylink]
#----
#+ H2:n:default:
## global MIPS CPU event counters (enable first with ecadmin(1))
#----
#+ H3:n:default:
## XBOW activity [xbowvis]
#----
# DO NOT UPDATE THE FILE ABOVE THIS LINE
# Otherwise any changes may be lost the next time pmlogconf.sh is
# used on this file.
#
# It is safe to make additions from here on ...
#
End-of-File
cp $tmp.conf $tmp.orig
# real QA test starts here
echo q \
| $PCP_BINADM_DIR/pmlogconf $tmp.conf >/dev/null
cat $tmp.conf >$seq.full
echo >>$seq.full
cat $tmp.awk >>$seq.full
$PCP_AWK_PROG -f $tmp.awk <$tmp.conf >$tmp.tmp
echo >>$seq.full
echo "after awking ..." >>$seq.full
cat $tmp.tmp >>$seq.full
diff $tmp.orig $tmp.tmp | _filter
# success, all done
exit
|