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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
|
# standard PCP QA test output filters
#
# Copyright (c) 1997-2002 Silicon Graphics, Inc. All Rights Reserved.
#
# pmcd log file
#
_filter_pmcd_log()
{
$PCP_AWK_PROG '
/^active/ { state = 1 }
/_pmRead: timeout/ && state == 0 { next }
/pduread: timeout/ && state == 0 { next }
/assuming PCP 1.x PMDA/ && state == 0 { next }
/ok .* INADDR_ANY/ { $2 = "FD" }
/ok .*pmcd.socket$/ { $2 = "FD"; $4 = "UNIX_DOMAIN_SOCKET" }
{ print }' \
| sed \
-e '/^__pmGetAddrInfo/d' \
-e '/:__pmHostEntFree(/d' \
-e '/^__pmHostEntGetName/d' \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' \
-e 's/^\[[A-Z].. [A-Z].. *[0-9][0-9]* ..:..:..]/[DATE]/' \
-e '/pcp([0-9][0-9]*)/s//pcp(PID)/' \
-e '/pcp\[[0-9][0-9]*]/s//pcp[PID]/' \
-e '/pmcd([0-9][0-9]*)/s//pmcd(PID)/' \
-e '/^\(Log for pmcd on\) [^ ][^ ]*/s//\1 HOST/' \
-e '/^pmcd: PID/s/=.*/= PID/' \
-e '/started PMDA/s/=.*/= PID/' \
-e 's/ \[0x[0-9a-f]*]//' \
-e '/^->/s/->[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/-> /' \
-e "s;$PCP_PMCDCONF_PATH;\$PCP_PMCDCONF_PATH;" \
-e '/get_scsi_sn:/d' \
-e '/Info: CleanupAgent/d' \
-e '/using .* kmem interface/d' \
-e '/pmcd_wait failed: exit status:/d' \
-e 's/: host-based access control/: access control/g' \
-e '/^User access list empty: user-based access control turned off$/d' \
-e '/^Group access list empty: group-based access control turned off$/d' \
-e '/pmcd caught SIG.* from pid=/s/=[0-9][0-9]*/=N/g' \
-e '/^linux.*pmda_linux/{
s/linux/[OS] /
s/60/??/
s/ i:[0-9] / i:? /
s/lib=[^ ]*/lib=[OS]pmda.$DSO_SUFFIX/
s/entry=[^ ]*/entry=[OS]_init/
}' \
-e '/^darwin.*pmda_darwin/{
s/darwin/[OS] /
s/78/??/
s/ i:[0-9] / i:? /
s/lib=[^ ]*/lib=[OS]pmda.$DSO_SUFFIX/
s/entry=[^ ]*/entry=[OS]_init/
}' \
-e '/^solaris.*pmda_solaris/{
s/solaris/[OS] /
s/75/??/
s/ i:[0-9] / i:? /
s/lib=[^ ]*/lib=[OS]pmda.$DSO_SUFFIX/
s/entry=[^ ]*/entry=[OS]_init/
}' \
-e "/^pmcd.*pmda_pmcd/s/lib=.*pmda_pmcd.$DSO_SUFFIX/lib=...pmda_pmcd.\$DSO_SUFFIX/" \
-e '/Warning:.* linux .* Direct mapping/d' \
-e '/NOTICE: using \/proc\/partitions for disk I\/O stats/d' \
-e '/NOTICE: using \/proc\/diskstats for disk I\/O stats/d' \
-e '/NOTICE: detected slabinfo version/d' \
-e '/Warning: xfs metrics are not available/d' \
-e '/Warning: cihb_getstats: info+recv init: /d' \
-e '/Warning: cihb_getstats: V0 api probe: Not supported/d' \
-e '/Warning: cihb_getstats: V0 api probe: Invalid argument/d' \
-e '/Warning: cihb_getstats: V[01] api probe: Resource temporarily unavailable/d' \
-e '/Warning: cihb_getstats: no stats available in this kernel/d' \
-e '/Warning: cihb_getstats: no support for V0 or V1 api/d' \
-e '/Warning: common_init: NON-CXFS Kernel: disabling metrics/d' \
-e '/Warning: nfsd_init: direct map disabled/d' \
-e '/Warning: cxfs_.*: NON-CXFS Kernel: disabling metrics/d' \
-e '/Warning: cxfs_.*: NON-CXFS or incompatible Kernel: disabling metrics/d' \
-e '/Warning: cxfs_common_init: direct map disabled/d' \
-e '/Warning: cxfs_server_init: direct map disabled/d' \
-e '/Warning: kmeminit: cannot change to group "sys": Operation not permitted/d' \
-e '/Warning: cms_getstats: could not retrieve stats version Not supported/d' \
-e '/Warning: cms_getstats: could not retrieve stats version Invalid argument/d' \
-e '/Warning: cms_reload: No cms instrumentation in this kernel:/d' \
-e '/Error: Cannot open stat device \/hw\/tape/d' \
-e '/Note: computed HZ=/d' \
-e '/Warning: Symbol address mismatch between System.map/d' \
-e '/Warning: mismatch for .* between System.map/d' \
-e '/Warning: only reported first .* mismatches between System.map/d' \
-e '/Warning: proc.psinfo.wchan_s symbol names may not be accurate!/d' \
-e '/Warning: Valid System.map file not found!/d' \
-e '/Warning: proc.psinfo.wchan_s symbol names cannot be derived!/d' \
-e '/Warning: Addresses will be returned for proc.psinfo.wchan_s instead!/d' \
-e '/NOTICE: using ".*" for kernel symbols map/d' \
-e '/NOTICE: using kernel 2\.4 or earlier CPU types/d' \
-e '/NOTICE: using kernel 2\.6\.0 to 2\.6\.4 CPU types/d' \
-e '/NOTICE: using 64 bit CPU time types/d' \
| sed \
-e '/Connected from.*Operations denied/{
P
: more
N
s/^..*\n//
t more
}' \
| $PCP_AWK_PROG '
/^active agent/ { state = 1 }
state == 2 && NF == 0 { state = 0 }
state == 2 { print base,$0; next }
{ print NR,$0 }
state == 1 && /^=====/ { state = 2; base = NR+1 }' \
| LC_COLLATE=POSIX _POSIX2_VERSION=0 sort +0n -1 +2n -3 \
| sed -e 's/^[^ ]* //'
}
# pmlogger log file
#
_filter_pmlogger_log()
{
sed \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/' \
-e 's/pmlogger([1-9][0-9]*) Error:/pmlogger(PID) Error:/' \
-e '/^pmlogger: Signalled (signal=[1-9][0-9]*).*/d' \
-e '/^\(Log for pmlogger on\) [^ ][^ ]*/s//\1 HOST/' \
-e '/^Starting logger/s/host ".*/host "HOST"/' \
-e '/^Archive basename: /s/:.*/: ARCHIVE/' \
-e '/^pmlc request/s/ from .*:/ from HOST:/'
}
# pmie log file
#
_filter_pmie_log()
{
sed \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]/DATE/' \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/TIMESTAMP/' \
-e '/^\(Log for pmie on\) [^ ][^ ]*/s//\1 HOST/' \
-e 's/^pmie: PID = [0-9][0-9]*, default host = .*/pmie: PID,HOST/g' \
-e '/pmie(.*) Info: pmie caught SIGINT or SIGTERM/d' \
-e '/pmie([0-9][0-9]*)/s//pmie(PID)/' \
-e '/^pmie: /s/- on line/- near line/'
}
_show_pmie_exit()
{
fgrep "evaluator exiting" | \
sed -e 's/.* Info: evaluator exiting/pmie: note - evaluator exiting/g'
}
_show_pmie_errors()
{
egrep -v '^Log finished |^Log for pmie on ' \
| $PCP_AWK_PROG '{ if (NF > 0) print }' \
| sed \
-e 's/.*Info: evaluator exiting/pmie: note - evaluator exiting/g' \
-e '/^pmie: /s/- on line/- near line/'
}
# pmdumplog -a
#
_filter_pmdumplog()
{
sed \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' \
-e 's/[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]$/DATE/' \
-e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \
-e '/^\(Performance metrics from host\) [^ ][^ ]*/s//\1 HOST/' \
-e '/^archive:/s/\( *\).*/\1ARCHIVE/' \
-e '/^host:/s/\( *\).*/\1HOST/'
}
# pmdumptext
#
_filter_pmdumptext()
{
sed \
-e 's/^[A-Z][a-z][a-z] [A-Z][a-z][a-z] *[0-9][0-9]* [0-9][0-9]:[0-9][0-9]:[0-9][0-9]/DATE/'
}
# some common -D diagnostics
#
_filter_dbg()
{
sed \
-e '/^__pmLogSetTime(/s/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g' \
-e '/^__pmLogRead:/s/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]\.[0-9][0-9][0-9]/TIMESTAMP/g'
}
# cull the optional PMDA
#
_filter_optional_pmdas()
{
sed \
-e '/pmdaaconex/d' \
-e '/pmdaapache/d' \
-e '/pmdaarray/d' \
-e '/pmdaash/d' \
-e '/pmdabash/d' \
-e '/pmdabonding/d' \
-e '/pmdabrocade/d' \
-e '/pmdacisco/d' \
-e '/pmdadbping/d' \
-e '/pmdadmcache/d' \
-e '/pmdadmf/d' \
-e '/pmda_environ/d' \
-e '/pmdaelasticsearch/d' \
-e '/pmdaespping/d' \
-e '/pmdagfs2/d' \
-e '/pmdagluster/d' \
-e '/pmdahippi/d' \
-e '/pmdahotproc/d' \
-e '/pmdaib/d' \
-e '/pmdainfiniband/d' \
-e '/pmdainfmx7/d' \
-e '/pmdainfmxping/d' \
-e '/pmdajbd2/d' \
-e '/pmdajstat/d' \
-e '/pmdakvm/d' \
-e '/pmdalab/d' \
-e '/pmdalogger/d' \
-e '/pmdalmsensors/d' \
-e '/pmdalockstat/d' \
-e '/pmdalsf/d' \
-e '/pmdamaillog/d' \
-e '/pmdamailq/d' \
-e '/pmdamemcache/d' \
-e '/pmdammv/d' \
-e '/pmdamounts/d' \
-e '/pmdampi/d' \
-e '/pmdamysql/d' \
-e '/pmdanamed/d' \
-e '/pmdanasavg/d' \
-e '/pmdanetfilter/d' \
-e '/pmdanetprobe/d' \
-e '/pmdanews/d' \
-e '/pmdanginx/d' \
-e '/pmdanvidia/d' \
-e '/pmdaoracle/d' \
-e '/pmdaoraping/d' \
-e '/pmdapapi/d' \
-e '/pmdapdns/d' \
-e '/pmdapmcd/d' \
-e '/pmdaproc/d' \
-e '/pmdaprocess/d' \
-e '/pmdarpm/d' \
-e '/pmdarsyslog/d' \
-e '/pmdaroomtemp/d' \
-e '/pmdasamba/d' \
-e '/pmdasendmail/d' \
-e '/pmdashping/d' \
-e '/pmda_simple/d' \
-e '/pmdasimple/d' \
-e '/pmdasnia/d' \
-e '/pmdasnmp/d' \
-e '/pmdassping/d' \
-e '/pmdasummary/d' \
-e '/pmdasystemd/d' \
-e '/pmdasystemtap/d' \
-e '/pmdasyb10/d' \
-e '/pmdasybping/d' \
-e '/pmdatrace/d' \
-e '/pmdatrivial/d' \
-e '/pmdatxmon/d' \
-e '/pmdavmware/d' \
-e '/pmdawatch/d' \
-e '/pmdaweblog/d' \
-e '/pmdawebping/d' \
-e '/pmdaxfs/d' \
-e '/pmdaxvm/d' \
-e '/pmdazimbra/d' \
-e '/pmdazswap/d' \
}
# cull the optional top-level PMNS entries
#
_filter_top_pmns()
{
sed \
-e 's/$/ /' \
-e '/^ aim /d' \
-e '/^ array /d' \
-e '/^ ash /d' \
-e '/^ bash /d' \
-e '/^ bonding /d' \
-e '/^ brocade /d' \
-e '/^ broken /d' \
-e '/^ cgroup /d' \
-e '/^ cisco /d' \
-e '/^ datatape /d' \
-e '/^ dbping /d' \
-e '/^ dmcache /d' \
-e '/^ dmf /d' \
-e '/^ elasticsearch /d' \
-e '/^ environ /d' \
-e '/^ gfs2 /d' \
-e '/^ gluster /d' \
-e '/^ hippi /d' \
-e '/^ hotproc /d' \
-e '/^ hw /d' \
-e '/^ infmxping /d' \
-e '/^ informix /d' \
-e '/^ jbd2 /d' \
-e '/^ jstat /d' \
-e '/^ kvm /d' \
-e '/^ lab /d' \
-e '/^ lmsensors /d' \
-e '/^ logger /d' \
-e '/^ lsf /d' \
-e '/^ mailq /d' \
-e '/^ memcache /d' \
-e '/^ mmv /d' \
-e '/^ mpi /d' \
-e '/^ mysql /d' \
-e '/^ named /d' \
-e '/^ netfilter /d' \
-e '/^ netprobe /d' \
-e '/^ news /d' \
-e '/^ nginx /d' \
-e '/^ nvidia /d' \
-e '/^ oracle /d' \
-e '/^ oraping /d' \
-e '/^ pdns /d' \
-e '/^ postgresql /d' \
-e '/^ proc /d' \
-e '/^ rpm /d' \
-e '/^ rsyslog /d' \
-e '/^ samba /d' \
-e '/^ sendmail /d' \
-e '/^ shping /d' \
-e '/^ simple /d' \
-e '/^ snmp /d' \
-e '/^ ssping /d' \
-e '/^ espping /d' \
-e '/^ summary /d' \
-e '/^ sybase /d' \
-e '/^ sybping /d' \
-e '/^ sysother /d' \
-e '/^ systemd /d' \
-e '/^ systemtap /d' \
-e '/^ trace /d' \
-e '/^ trivial /d' \
-e '/^ txmon /d' \
-e '/^ vmware /d' \
-e '/^ web /d' \
-e '/^ webping /d' \
-e '/^ zimbra /d' \
-e '/^ zswap /d' \
-e 's/ $//'
}
# handle pmDumpResult() output
#
_filter_dumpresult()
{
sed \
-e '/pmResult/s/ .* numpmid/ ... numpmid/' \
-e '/[0-9][0-9]:[0-9][0-9]:[0-9][0-9]/s/[^ ]*/TIMESTAMP/' \
-e '/value /{
s/\(value.*\) 0x[0-9a-f][0-9a-f]*/\1 HEXNUMBER/
s/\(value.*\) -*[0-9][0-9]*\.[0-9][0-9]*e[+-]*[0-9][0-9]*/\1 NUMBER/
s/\(value.*\) -*[0-9][0-9]*\.[0-9][0-9]*/\1 NUMBER/
s/\(value.*\) -*[0-9][0-9]*\.[0-9][0-9]*/\1 NUMBER/
s/\(value.*\) -*[0-9][0-9]*e[+-]*[0-9][0-9]*/\1 NUMBER/
s/\(value.*\) -*[0-9][0-9]*/\1 NUMBER/
s/\(value.*\) \[.*]/\1 AGGREGATE/
s/\(value.*\) ".*"/\1 STRING/
}' \
-e '/inst /{
s/inst \[[0-9][0-9]* or "dks..."]/inst [DISK]/
s;inst \[[0-9][0-9]* or "/dev/[^"]*"];inst [DISK];
}'
}
_filter_cron_scripts()
{
sed \
-e 's/cron\.pmcheck/PMLOGGER.CHECK/g' \
-e 's/pmlogger_check/PMLOGGER.CHECK/g' \
-e 's/pmlogger\.check/PMLOGGER.CHECK/g' \
-e 's/cron\.pmdaily/PMLOGGER.DAILY/g' \
-e 's/pmlogger_daily/PMLOGGER.DAILY/g' \
-e 's/pmlogger\.daily/PMLOGGER.DAILY/g' \
-e 's/cron\.logmerge/PMLOGGER.MERGE/g' \
-e 's/cron\.pmlogmerge/PMLOGGER.MERGE/g' \
-e 's/pmlogger\.merge/PMLOGGER.MERGE/g' \
-e 's/pmlogger_merge/PMLOGGER.MERGE/g' \
-e 's/cron\.pmsnap/pmsnap/g'
}
_filter_pcp_start()
{
sed \
-e "s;$PCP_LOG_DIR/pmcd/pmcd.log;\$PCP_LOG_DIR/pmcd.log;" \
-e "s;$PCP_LOG_DIR/pmcd.log;\$PCP_LOG_DIR/pmcd.log;" \
-e "s;$PCP_RC_DIR/pmcd;\$PCP_RC_DIR/pmcd;" \
-e "s;$PCP_RC_DIR/pmlogger;\$PCP_RC_DIR/pmlogger;" \
-e "s;$PCP_RC_DIR/pcp;\$PCP_RC_DIR/pmcd;" \
-e '/$PCP_RC_DIR\/pmcd/{
s/ PMCD / pmcd /
}' \
-e "s;$PCP_BINADM_DIR/pmcd;\$PCP_BINADM_DIR/pmcd;" \
-e "s;$PCP_PMCDCONF_PATH;\$PCP_PMCDCONF_PATH;" \
-e "s;$PCP_PMLOGGERCONTROL_PATH;\$PCP_PMLOGGERCONTROL_PATH;" \
-e "s;$PCP_VAR_DIR/;\$PCP_VAR_DIR/;" \
-e "s;$PCP_SYSCONF_DIR/;\$PCP_SYSCONF_DIR/;" \
-e "s;/usr/etc/pmcd;\$PCP_BINADM_DIR/pmcd;" \
-e '/Warning: Forcing PMCD to terminate!/s/PMCD/pmcd/' \
-e '/^Starting PCP$/d' \
-e 's/^\(Performance Co-Pilot starting .*\.\.\.\) *\(\$PCP_RC_DIR\)/\1\
\2/' \
-e '/^Performance Co-Pilot/s/\.\.\. *$/.../' \
-e '/^Performance Co-Pilot starting/{
s/\.\.\.[. ]*done/.../
s/\.\.\.[. ]*failed/.../
s/Performance Co-Pilot starting PMCD (logfile is [^)]*) .../Starting pmcd ... /
s/Performance Co-Pilot starting archive loggers .../Starting pmlogger ... /
}' \
-e '/^Performance Co-Pilot installing/s//Installing/' \
-e '/^\.[. ]*done$/d' \
-e '/^\.[. ]*failed$/d' \
-e '/^Waiting for PMCD/{
s/PMCD/pmcd/
s/\.\.\.[. ]*done/.../
s/\.\.\.\.*/.../
}' \
-e '/^Waiting for pmcd/{
s/\.\.\.[. ]*done/.../
s/\.\.\.\.*/.../
}' \
-e 's/^\(Waiting .*\.\.\.\)\(\$PCP_RC_DIR\)/\1\
\2/' \
-e '/^[ ]*$/d' \
| _filter_init_distro
}
_filter_pcp_stop()
{
sed \
-e '/Stopping pmlogger .../d' \
-e '/^Waiting for PMIE/s/PMIE/pmie/' \
-e '/^Waiting for pmie/s/\.\.\.[. ]*done/.../' \
-e '/^Waiting for PMCD/{
s/\.\.\.[. ]*done/.../
s/PMCD/pmcd/
s/\.\.\.\.*/.../
}' \
-e '/^Waiting for pmcd/{
s/\.\.\.[. ]*done/.../
s/\.\.\.\.*/.../
}' \
-e '/Warning: Forcing PMCD to terminate!/s/PMCD/pmcd/' \
-e '/^Waiting for pmie/s/\.\.\. *$/.../' \
-e '/^Performance Co-Pilot/s/\.\.\. *$/.../' \
-e '/^\.[. ]*done$/d' \
| _filter_init_distro
}
_filter_pmie_start()
{
sed \
-e '/^Waiting for PMIE/s/PMIE/pmie/' \
-e '/^Waiting for pmie process(es) to terminate/d' \
-e "s;$PCP_RC_DIR/pmie;\$PCP_RC_DIR/pmie;g" \
-e '/(pmie) is disabled/d' \
-e '/To enable/d' \
-e '/update-rc.d -f pmie remove/d' \
-e '/update-rc.d pmie defaults/d' \
-e '/\/sbin\/chkconfig pmie on/d' \
-e '/\/usr\/sbin\/sysv-rc-conf pmie on/d' \
-e '/update-rc.d -f pmie defaults/d' \
-e '/ln -sf \.\.\/init.d\/pmie \/etc\/rc\.d\//d' \
-e "s;$PCP_PMIECONTROL_PATH;\$PCP_PMIECONTROL_PATH;" \
-e '/^\.\.*done$/d' \
-e "s;/private/tmp;/tmp;g" \
-e '/^$/d' \
| _filter_init_distro
}
_filter_pmie_stop()
{
sed \
-e "s;$PCP_RC_DIR/pmie;\$PCP_RC_DIR/pmie;g" \
-e '/^Waiting for PMIE/s/PMIE/pmie/' \
-e '/^Waiting for pmie/s/\.\.\.[. ]*done/.../' \
-e '/^Waiting for pmie/s/\.\.\. *$/.../' \
| _filter_init_distro
}
_filterall_pcp_start()
{
_filter_pcp_start \
| sed \
-e '/rebuilding PMNS/d' \
-e '/installing /d'
}
_sort_pmdumplog_d()
{
cat >$tmp.tmp
egrep '(^Descriptions)|(^$)' $tmp.tmp
$PCP_AWK_PROG <$tmp.tmp '
/^Descriptions/ { next }
NF == 0 { next }
$1 == "PMID:" { printf "%s|",$0; next }
$1 == "Data" { printf "%s|",$0; next }
{ print }' \
| LC_COLLATE=POSIX _POSIX2_VERSION=0 sort -t'(' +1 -2 \
| tr '|' '\012' \
| src/hex2nbo
}
_filter_pmda_install()
{
sed \
-e 's/.* \(hash table entries\)/ NNN \1/' \
-e 's/.* \(non-leaf nodes\)/ NNN \1/' \
-e 's/.* \(leaf nodes\)/ NNN \1/' \
-e 's/.* \(bytes of symbol table\)/ NNN \1/' \
-e '/^Installing .mchart view*/d' \
-e '/Terminate PMDA/,/Updating the PMCD/c\
Terminate PMDA if already installed ...\
[...install files, make output...]\
Updating the PMCD control file, and notifying PMCD ...' \
-e '/Installing files/,/Updating the Performance Metrics/c\
Installing files ...\
[...install files, make output...]\
Updating the Performance Metrics Name Space (PMNS) ...'
}
_filter_pmda_remove()
{
_filter_pmda_install |
sed \
-e '/Removing files/d' \
-e '/Updating the PMCD control file/c\
Updating the PMCD control file, and notifying PMCD ...\
[...removing files...]'
}
# Make sure that quotes which span multiple lines get appended onto
# the one line, separated by \\n (instead of newlines).
# This allows for easier sed processing.
# BUG: problem handling a single " which isn't supposed to match,
# say in a comment or pattern search
# Partial solution: filter out: /"/
#
_quote_filter()
{
sed -e 's#/"/#/dbl-quote/#g' |\
$PCP_AWK_PROG '
/"/ { # unfinished quote - start or end
n = split($0, arr, /"/)
if ( (n % 2) == 0) { # odd number of quotes
line[line_num++] = $0
if (inquote) {
inquote = 0
for(i=0;i<=line_num;i++){
printf("%s\\n", line[i])
}
printf("\n")
line_num = 0
}
else {
inquote = 1
}
next
}
else {
print; next
}
}
inquote == 1 {
line[line_num++] = $0
next
}
{print}
'
}
#
# concat lines between inst/value pairs
# inst ... value
# inst ... value XXXX
# YYYYYYY
# inst ... value
# becomes
# inst ... value
# inst ... value XXXX\\nYYYYYYY
# inst ... value
#
_inst_value_filter()
{
$PCP_AWK_PROG '
function print_line() {
if (line_num > 0) {
for(i=0;i<line_num-1;i++){
printf("%s\\n", line[i])
}
printf("%s", line[line_num-1]);
printf("\n")
line_num = 0
}
}
$1 == "inst" && $2 ~ /^\[/ {
print_line()
line[line_num++] = $0
next
}
# terminate run of inst...value ".... extending over multiple
# lines with a line ending in a ", or a line introducing new
# proc metric
/"$/ && line_num > 0 {
line[line_num++] = $0
print_line()
next
}
( (/proc\./ && /numval/ && /valfmt/) || /^proc\./ ) \
&& line_num > 0 {
x = $0
print_line()
print x
next
}
line_num>0 { # continuation of value
line[line_num++] = $0
next
}
{print}
END {
print_line()
}
'
}
_filter_torture_api()
{
sed \
-e '/Name space load/d' \
-e '/PMAPI operations/s/[0-9][0-9]* PMAPI/N PMAPI/' \
| _filter_top_pmns \
| _filter_dumpresult \
| sed -e '/PM_ID_NULL/{
/No values returned!/s//No PMDA, no values [filtered]/
/No PMCD agent for domain of request/s//No PMDA, no values [filtered]/
}' \
-e '/kernel\.all\.pswitch/s/valfmt: [01]/valfmt: 0-or-1/' \
-e '/kernel\.all\.cpu/s/valfmt: [01]/valfmt: 0-or-1/' \
-e '/^ hostname /d' \
-e '/^ license /d' \
-e '/^ services /d' \
-e '/^ aconex /d' \
-e '/^ apache /d' \
-e '/^ bonding /d' \
-e '/^ cihb /d' \
-e '/^ cms /d' \
-e '/^ cxfs /d' \
-e '/^ dmcache /d' \
-e '/^ dynamic /d' \
-e '/^ elasticsearch /d' \
-e '/^ engr /d' \
-e '/^ feature /d' \
-e '/^ idiot /d' \
-e '/^ idl /d' \
-e '/^ infiniband /d' \
-e '/^ ipc /d' \
-e '/^ kaio /d' \
-e '/^ kpreempt /d' \
-e '/^ kswitch /d' \
-e '/^ kvm /d' \
-e '/^ maillog /d' \
-e '/^ mounts /d' \
-e '/^ mt /d' \
-e '/^ named /d' \
-e '/^ nasavg /d' \
-e '/^ netfilter /d' \
-e '/^ numa /d' \
-e '/^ nvidia /d' \
-e '/^ origin /d' \
-e '/^ papi /d' \
-e '/^ pdns /d' \
-e '/^ p76 /d' \
-e '/^ process /d' \
-e '/^ roomtemp /d' \
-e '/^ rpm /d' \
-e '/^ rsyslog /d' \
-e '/^ samba /d' \
-e '/^ softtemp /d' \
-e '/^ stream /d' \
-e '/^ sysfs /d' \
-e '/^ sysioctl /d' \
-e '/^ tmpfs /d' \
-e '/^ udf /d' \
-e '/^ vfs /d' \
-e '/^ vmware /d' \
-e '/^ waitio /d' \
-e '/^ xvm /d' \
-e '/^ zimbra /d' \
-e '/^ zswap /d' \
}
_filter_install()
{
sed \
-e 's/.* \(hash table entries\)/ NNN \1/' \
-e 's/.* \(non-leaf nodes\)/ NNN \1/' \
-e 's/.* \(leaf nodes\)/ NNN \1/' \
-e 's/.* \(bytes of symbol table\)/ NNN \1/' \
-e '/Performance Co-Pilot starting/d'
}
_filter_post()
{
sed \
-e 's/^host [^ :]*:/host <host>:/'
}
_filter_console()
{
sed \
-e 's/^ *[0-9]*\.[0-9][0-9]/<timestamp>/' \
-e 's/0x0$/(nil)/' \
-e 's/0x[0-9a-f]*/<addr>/' \
-e 's/src=[^ ]*/src=<host>/' \
-e '/Tab::updateTimeAxis:/s/used .*/used .../'
}
_filter_views()
{
sed \
-e "s,^Load View: $PCP_VAR_DIR,Load View: PCP_VAR_DIR," \
-e '/QGtkStyle was unable to detect the current GTK+ theme./d'
}
|