-
Notifications
You must be signed in to change notification settings - Fork 3
/
nmonchart
executable file
·1440 lines (1275 loc) · 43.6 KB
/
nmonchart
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
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/ksh
# License GNU General Public License version 3.0 (GPLv3)
# (c) Copyright 2015. Nigel Griffiths
export nmonchart_version=35.dw
# Set wantCONFIG to 0 (zero) to switch off config button or 1 to switch it on
wantCONFIG=1
# Set wantZOOM to 0 (zero) to switch off the zoom function or 1 to switch it on
wantZOOM=1
# Set if you want the new fast mode using awk instead of slower sed loops
fastmode=1
# Work around syntax differences in AIX has the aixpert command and Linux which does not
if [[ -e /usr/sbin/aixpert ]]
then
# echo running on AIX
export ECHO="echo "
export SORTARG=" -t, +2 "
export PRINTN="print -n "
else
#echo running on Linux
export ECHO="echo -e "
export SORTARG=" -k2 "
export PRINTN="echo -n "
fi
if (( wantCONFIG ))
then
config_start()
{
$ECHO '<script>'
$ECHO 'function config() {'
$ECHO ' var myWindow = window.open("", "MsgWindow", "width=1024, height=800");'
$ECHO ' myWindow.document.write("<h2>Configuration data for' $ORIGINAL '<br>Use PageDown or Scroll bar (if available)</h2><br>\\'
}
config_end()
{
$ECHO '");'
$ECHO '}'
$ECHO '</script>'
}
config_button()
{
$ECHO '\t<button onclick="config()"><b>Configuration</b></button> '
}
fi
# first part of the .html file
html_start()
{
$ECHO '<html>'
$ECHO '\t<head>'
$ECHO '\t\t<title>nmonChart</title>'
if (( wantCONFIG ))
then
config_start $1
grep ^AAA $INPUT | grep -v ^AAA,note | awk -F, '{ printf "<b>%s</b> = %s<br>\\\n",$2,$3}'
grep ^BBB $INPUT | grep -v ^BBBP| sed 's/"//g' | sed 's/,/:/' | sed 's/,/:/' | awk -F: '{ printf "<b>%s</b> %s %s<br>\\\n",$1,$2,$3}'
grep ^BBBP $INPUT | sed 's/"//g' | awk -F, '{ printf "%s <b>%s</b> %s<br>\\\n",$2,$3,$4}'
config_end
fi
$ECHO '\t\t<script type="text/javascript" src="https://www.google.com/jsapi"></script>'
$ECHO '\t\t<script type="text/javascript">'
$ECHO '\t\tgoogle.load("visualization", "1.1", {packages:["corechart"]});'
$ECHO
$ECHO '\t\tgoogle.setOnLoadCallback(setupCharts);'
$ECHO '\t\t'
$ECHO '\t\tfunction setupCharts() {'
$ECHO '\t\t'
$ECHO '\t\tvar chart = null;'
$ECHO
}
# declare array for the data
chart_start()
{
$ECHO '\t\t\tvar data_'$1 '= google.visualization.arrayToDataTable(['
}
# finish the data area and create Area Chart
chart_end()
{
$ECHO '\t\t]);'
$ECHO
$ECHO '\t\tvar options_'$1' = {'
$ECHO '\t\t\tchartArea: {left: "5%", width: "85%", top: "10%", height: "80%"},'
$ECHO '\t\t\ttitle: "'$2'",'
$ECHO '\t\t\tfocusTarget: "category",'
$ECHO '\t\t\thAxis: {'
$ECHO '\t\t\t\tgridlines: {'
$ECHO '\t\t\t\t\tcolor: "lightgrey",'
$ECHO '\t\t\t\t\tcount: 30'
$ECHO '\t\t\t\t}'
$ECHO '\t\t\t},'
$ECHO '\t\t\tvAxis: {'
$ECHO '\t\t\t\tgridlines: {'
$ECHO '\t\t\t\t\tcolor: "lightgrey",'
$ECHO '\t\t\t\t\tcount: 11'
$ECHO '\t\t\t\t}'
$ECHO '\t\t\t},'
if (( wantZOOM ))
then
$ECHO '\t\t\texplorer: { actions: ["dragToZoom", "rightClickToReset"],'
$ECHO '\t\t\t\taxis: "horizontal",'
$ECHO '\t\t\t\tkeepInBounds: true,'
$ECHO '\t\t\t\tmaxZoomIn: 20.0'
$ECHO '\t\t\t},'
fi
$ECHO '\t\t\tisStacked: ' $3
$ECHO '\t\t};'
$ECHO
$ECHO '\t\tdocument.getElementById("draw_'$1'").addEventListener("'click'", function() {'
$ECHO '\t\tif (chart && chart.clearChart) chart.clearChart();'
$ECHO
$ECHO '\t\tchart = new google.visualization.AreaChart(document.getElementById("chart_master"));'
$ECHO '\t\tchart.draw( data_'$1', options_'$1');'
$ECHO '\t\t});'
$ECHO
}
# finish the data area and create Bar Chart
chart_end_column()
{
$ECHO '\t\t]);'
$ECHO
$ECHO '\t\tvar options_'$1' = {'
$ECHO '\t\t\tchartArea: {left: "5%", width: "85%", top: "10%", height: "80%"},'
$ECHO '\t\t\ttitle: "'$2'",'
$ECHO '\t\t\tfocusTarget: "category",'
$ECHO '\t\t\tvAxis: {'
$ECHO '\t\t\t\tgridlines: {'
$ECHO '\t\t\t\t\tcolor: "lightgrey",'
$ECHO '\t\t\t\t\tcount: 11'
$ECHO '\t\t\t\t}'
$ECHO '\t\t\t},'
$ECHO '\t\t\tisStacked: ' $3
$ECHO '\t\t};'
$ECHO
$ECHO '\t\tdocument.getElementById("draw_'$1'").addEventListener("'click'", function() {'
$ECHO '\t\tif (chart && chart.clearChart) chart.clearChart();'
$ECHO
$ECHO '\t\tchart = new google.visualization.ColumnChart(document.getElementById("chart_master"));'
$ECHO '\t\tchart.draw( data_'$1', options_'$1');'
$ECHO '\t\t});'
$ECHO
}
# Variation of the above for TOPSUM graph
chart_end_top()
{
$ECHO '\t\t]);'
$ECHO
$ECHO '\t\tvar options_TOPSUM = {'
$ECHO '\t\t\tchartArea: {left: "5%", width: "85%", top: "10%", height: "80%"},'
$ECHO '\t\t\ttitle: "Top 20 processes by CPU correlation between CPU-seconds(Total), Character-I/O(Total), Memory-Size(Max) for each Command Name",'
$ECHO '\t\t\thAxis: {title: "CPU seconds in Total"},'
$ECHO '\t\t\tvAxis: {title: "Character I/O in Total"},'
$ECHO '\t\t\tsizeAxis: {maxSize: 200},'
$ECHO '\t\t\tbubble: {textStyle: {fontSize: 15}}'
$ECHO '\t\t};'
$ECHO
$ECHO '\t\tdocument.getElementById("draw_TOPSUM").addEventListener("'click'", function() {'
$ECHO '\t\tif (chart && chart.clearChart) chart.clearChart();'
$ECHO
$ECHO '\t\tchart = new google.visualization.BubbleChart(document.getElementById("chart_master"));'
$ECHO '\t\tchart.draw( data_TOPSUM, options_TOPSUM);'
$ECHO '\t\t});'
$ECHO
}
# data is reused and we just add the same chart but unstacked - used in Disk unstacked
chart_add_unstacked()
{
$ECHO '\t\tvar options_'$1'u = {'
$ECHO '\t\t\tchartArea: {left: "5%", width: "85%", top: "10%", height: "80%"},'
$ECHO '\t\t\ttitle: "'$2'",'
$ECHO '\t\t\tfocusTarget: "category",'
$ECHO '\t\t\thAxis: {'
$ECHO '\t\t\t\tgridlines: {'
$ECHO '\t\t\t\t\tcolor: "lightgrey",'
$ECHO '\t\t\t\t\tcount: 30'
$ECHO '\t\t\t\t}'
$ECHO '\t\t\t},'
$ECHO '\t\t\tvAxis: {'
$ECHO '\t\t\t\tgridlines: {'
$ECHO '\t\t\t\t\tcolor: "lightgrey",'
$ECHO '\t\t\t\t\tcount: 11'
$ECHO '\t\t\t\t}'
$ECHO '\t\t\t},'
$ECHO '\t\t\tisStacked: 0'
$ECHO '\t\t};'
$ECHO
$ECHO '\t\tdocument.getElementById("draw_'$1'u").addEventListener("'click'", function() {'
$ECHO '\t\tif (chart && chart.clearChart) chart.clearChart();'
$ECHO
$ECHO '\t\tchart = new google.visualization.AreaChart(document.getElementById("chart_master"));'
$ECHO '\t\tchart.draw( data_'$1', options_'$1'u);'
$ECHO '\t\t});'
$ECHO
}
# Finished the .html heads ections and entire the body then output top nmon file name
html_mid()
{
$ECHO '\t\t}'
$ECHO '\t\t</script>'
$ECHO '\t</head>'
$ECHO '\t <body bgcolor="#EEEEFF">'
$ECHO '\tnmon data file: <b>'$ORIGINAL'</b> '
if (( wantCONFIG ))
then
config_button
fi
if (( hasTOP ))
then
chart_button TOPSUM "Top Summary" black
chart_button TOPCMD "Top Commands" black
fi
if (( hasDISKBUSY1 ))
then
chart_button TOPDISK "Top Disk" black
fi
$ECHO '\t<br>'
#$ECHO '\t <hr>'
}
# Add and the graph drawing buttouns at the top of the page
chart_button()
{
$ECHO '\t<button id="draw_'$1'" style="color:'$3';"><b>'$2'</b></button>'
}
# This is the placement of where the graphs get placed
chart_draw()
{
$ECHO ""
$ECHO '\t<div id="chart_master" style="width:100%; height:75%;">'
$ECHO '\t<h2 style="color:blue">Click on a Graph button above, to display that graph</h2>'
$ECHO '\t</div>'
$ECHO ""
}
# Finish the .html file
html_end()
{
$ECHO '\t</body>'
$ECHO '</html>'
}
# Called to generate the data for the fixed format nmon file lines - just extract the data colum needed and reformat it necessary
# The parameter is graph name
chart()
{
# note: '\'' is VERY special and means to get around the impossible ' in a awk string
# ' = end the awk program string
# \' = escaped so its just a character
# ' = start the awk program string again
# strings are concatenated to the end and start disappear but this allows a ' char to be added
# as strings are concatenated by the shell before awk gets it, this just adds a single quote = '
chart_start $1
case $1 in
CPUUTIL_ALL)
awk -F , '
/^CPUUTIL_ALL,C/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'','\''" $9 "'\'','\''" $10 "'\'','\''" $11 "'\'','\''" $12 "'\'']" }
/^CPUUTIL_ALL,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "," $9 "," $10 "," $11 "," $12 "]" }
' <$INPUT
;;
PHYSICAL_CPU)
awk -F , '
/^LPAR,L/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $7 "'\'']" }
/^LPAR,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $7 "]" }
' <$INPUT
;;
PHYSICAL_CPU_LINUX)
awk -F , '
/^LPAR,S/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''Entitlement'\'','\''VP'\'']" }
/^LPAR,T/ { print ",['\''" $2 "'\''," $3 "," $10 "," $14 "]" }
' <$INPUT
;;
GPU_UTIL)
awk -F , '
/^GPU_UTIL,G/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'','\''" $9 "'\'','\''" $10 "'\'']" }
/^GPU_UTIL,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "," $9 "," $10 "]" }
' <$GPUINPUT
;;
GPU_UMEM)
awk -F , '
/^GPU_UMEM,G/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'','\''" $9 "'\'','\''" $10 "'\'']" }
/^GPU_UMEM,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "," $9 "," $10 "]" }
' <$GPUINPUT
;;
GPU_TEMP)
awk -F , '
/^GPU_TEMP,G/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'','\''" $9 "'\'','\''" $10 "'\'']" }
/^GPU_TEMP,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "," $9 "," $10 "]" }
' <$GPUINPUT
;;
GPU_WATTS)
awk -F , '
/^GPU_WATTS,G/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'','\''" $9 "'\'','\''" $10 "'\'']" }
/^GPU_WATTS,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "," $9 "," $10 "]" }
' <$GPUINPUT
;;
GPU_MEM)
awk -F , '
/^GPU_MEM,G/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'','\''" $9 "'\'','\''" $10 "'\'']" }
/^GPU_MEM,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "," $9 "," $10 "]" }
' <$GPUINPUT
;;
CPU_UTIL)
if (( hasSTEAL ))
then
awk -F , '
/^CPU_ALL,C/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'']" }
/^CPU_ALL,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "]" }
' <$INPUT
else
awk -F , '
/^CPU_ALL,C/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'']" }
/^CPU_ALL,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "]" }
' <$INPUT
fi
;;
POOLIDLE)
awk -F , '
/^LPAR,L/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $6 "'\'','\''" $9 "'\'']" }
/^LPAR,T/ { print ",['\''" $2 "'\''," $6 "," $9 "]" }
' <$INPUT
;;
POOLIDLE_LINUX)
awk -F , '
/^LPAR,S/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''PoolSize'\'','\''PoolFree'\'']" }
/^LPAR,T/ { print ",['\''" $2 "'\''," $8 "," $21 "]" }
' <$INPUT
;;
REALMEM)
awk -F , '
/^MEM,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $5 "'\'','\''" $7 "'\'']" }
/^MEM,T/ { print ",['\''" $2 "'\''," $5 "," $7 "]" }
' <$INPUT
;;
MEM_LINUX)
awk -F , '
/^MEM,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $7 "'\'','\''" $12 "'\'','\''" $13 "'\'','\''" $15 "'\'','\''" $17"'\'']" }
/^MEM,T/ { print ",['\''" $2 "'\''," $3 "," $7 "," $12 "," $13 "," $15 "," $17 "]" }
' <$INPUT
;;
VIRTMEM)
awk -F , '
/^MEM,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $6 "'\'','\''" $8 "'\'']" }
/^MEM,T/ { print ",['\''" $2 "'\''," $6 "," $8 "]" }
' <$INPUT
;;
SWAP_LINUX)
awk -F , '
/^MEM,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $6 "'\'','\''" $10 "'\'']" }
/^MEM,T/ { print ",['\''" $2 "'\''," $6 "," $10 "]" }
' <$INPUT
;;
FSCACHE)
awk -F , '
/^MEMUSE,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'']" }
/^MEMUSE,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "]" }
' <$INPUT
;;
# MEMNEW)
# awk -F , '
# /^MEMNEW,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6"'\'','\''" $7"'\'','\''" $8"'\'']" }
# /^MEMNEW,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "," $7 "," $8 "]" }
# ' <$INPUT
# ;;
MEMNEW)
awk -F , '
/^MEMNEW,M/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'']" }
/^MEMNEW,T/ { print ",['\''" $2 "'\''," $3 "," $4 "," $5 "," $6 "]" }
' <$INPUT
;;
RUNQ)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $3 "]" }
' <$INPUT
;;
RUNQBLOCK)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $3 "," $4 "]" }
' <$INPUT
;;
PSWITCH)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $5 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $5 "]" }
' <$INPUT
;;
SYSCALL)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $6 "'\'','\''" $7 "'\'','\''" $8 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $6 "," $7 "," $8 "]" }
' <$INPUT
;;
READWRITE)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $7 "'\'','\''" $8 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $7 "," $8 "]" }
' <$INPUT
;;
FORKEXEC)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $9 "'\'','\''" $10 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $9 "," $10 "]" }
' <$INPUT
;;
FILEIO)
awk -F , '
/^FILE,F/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $6 "'\'','\''" $7 "'\'']" }
/^FILE,T/ { print ",['\''" $2 "'\''," $6 "," $7 "]" }
' <$INPUT
;;
PAGING)
awk -F , '
/^PAGE,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $4 "'\'','\''" $5 "'\'','\''" $6 "'\'','\''" $7 "'\'']" }
/^PAGE,T/ { print ",['\''" $2 "'\''," $4 "," $5 "," $6 "," $7 "]" }
' <$INPUT
;;
SWAPIN)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $4 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $4 "]" }
' <$INPUT
;;
PROCCOUNT)
awk -F , '
/^PROCCOUNT,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'']" }
/^PROCCOUNT,T/ { print ",['\''" $2 "'\''," $3 "]" }
' <$INPUT
;;
MORE1)
awk -F , '
/^MORE1,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'']" }
/^MORE1,T/ { print ",['\''" $2 "'\''," $3 "]" }
' <$INPUT
;;
MORE3)
awk -F , '
/^MORE3,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $3 "'\'','\''" $4 "'\'','\''" $5 "'\'']" }
/^MORE3,T/ { print ",['\''" $2 "'\''," $3 "'\''," $4 "'\''," $5 "]" }
' <$INPUT
;;
IPC)
awk -F , '
/^PROC,P/ { print "[{type: '\''datetime'\'', label: '\''Datetime'\'' },'\''" $11 "'\'','\''" $12 "'\'']" }
/^PROC,T/ { print ",['\''" $2 "'\''," $11 "," $12 "]" }
' <$INPUT
;;
*) $ECHO Oh dear, no code to handle chart name $1
;;
esac
chart_end $1 "$2" $3
}
# nmonchart command help
hint()
{
$ECHO
$ECHO Hint: nmonchart nmon_file html_file
$ECHO Version $nmonchart_version
$ECHO
$ECHO Hint: nmonchart nmon_file html_file
$ECHO "\tnmon_file \t1st parameter is the nmon capatured data file like hostname_date_time.nmon"
$ECHO "\thtml_file \t2nd parameter is the output file on your website directory like /webpages/docs/hostname_date_time.html"
$ECHO "\t\t\tNow optional. If not given the output file uses the 1st parameter but changes .nmon to .html"
$ECHO "\t\t\tif the inputfile name does not end with .nmon then the .html is just added"
$ECHO
$ECHO "\tExample: nmonchart mynmonfile.nmon"
$ECHO "\t\t the output file will be mynmonfile.html"
$ECHO "\tExample: nmonchart nmon_file.csv"
$ECHO "\t\t the output file will be nmon_file.csv.html"
$ECHO "\tExample: nmonchart mynmonfile.nmon /webpages/docs/mycharts.html"
$ECHO
exit
}
#------------------------------------ Don't change anything above here
#------------------------------------ Add new grpahs below
# this function used to redirect output into the .html file
generate()
{
html_start
# Straight forward graphs where we have to pick the data out of the line with fixed numbers of columns
if (( isAIX ))
then
if (( hasLPARstats ))
then
chart PHYSICAL_CPU "Physical CPU Use of Shared CPU(s) (Note:if Entitlement=VP then LPAR is capped)" 0
chart POOLIDLE "Whole machine Shared Physical CPU Pool Use (If all PoolIdle=0 it means perf stats are not switch on at VM level)" 0
fi
else # Linux
if (( hasLPARstats ))
then
chart PHYSICAL_CPU_LINUX "Physical CPU Use of Shared CPU(s) (Note:if Entitlement=VP then LPAR is capped)" 0
chart POOLIDLE_LINUX "Whole machine Shared Physical CPU Pool Use (If all PoolIdle=0 it means perf stats are not switch on at VM level)" 0
fi
fi
chart CPU_UTIL "CPU Utilisation Percentages" 1
if (( isAIX ))
then
chart REALMEM "Real Memory - RAM in MB" 0
chart VIRTMEM "Virtual Memory - Paging Space in MB" 0
chart FSCACHE "Filesystem Cache Memory Use (numperm) Percentage" 0
chart MEMNEW "Memory Use System, Process, Cache & Free Memory Percentage" 1
else
if(( hasCPUUTIL_ALL ))
then
chart CPUUTIL_ALL "Linux CPU Utilisation FULL details" 1
fi
if(( hasGPU ))
then
# Work around that some system can have 1 GPU adapter/socket instead of the maximum of two
# Each adpater/socket has two GPUs so its two or four GPUs
grep ^GPU $INPUT | sed 's/$/,0,0,0,0,0,0,0/' >$GPUINPUT
chart GPU_UTIL "GPU Utilisation Percent" 0
chart GPU_UMEM "GPU Memory Utilisation Percent" 0
chart GPU_TEMP "GPU Temperature C" 0
chart GPU_WATTS "GPU Power Draw Watts" 0
chart GPU_MEM "GPU Memory MB" 0
rm $GPUINPUT
fi
if(( hasMHZ ))
then
chart_start MHZ
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^MHZ,C $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^MHZ,T $INPUT | sed -e "s/MHZ,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end MHZ "CPU MHz (Stacked)" 1
fi
chart MEM_LINUX "Real Memory - RAM in MB" 0
chart SWAP_LINUX "Virtual Memory - Paging Space in MB" 0
fi
if (( isAIX ))
then
chart RUNQ "Run Queue - processes that running or ready to run" 0
else
chart RUNQBLOCK "Run Queue - processes that running or ready to run or Blocked" 0
fi
chart PSWITCH "Process Switches per second - between processes" 0
if (( isAIX ))
then
chart SYSCALL "System Calls per second from application to the kernel" 0
chart READWRITE "Read and Write System Calls per second - for disk & network I/O" 0
fi
chart FORKEXEC "Fork() and Exec() System Calls per second - creating processes" 0
if (( isAIX ))
then
chart FILEIO "File I/O through read() & write() System Calls (disk, pipe & network socket) in bytes per second" 0
fi
if (( isAIX ))
then
chart PAGING "Paging from Pagespace (pgin & pgout) & Paging from Filesystem (pgsin & pgsout) per second" 0
chart SWAPIN "Process Swap-In per second" 0
fi
if (( hasPROCCOUNT ))
then
chart PROCCOUNT "Process Count" 0
fi
if (( hasMORE1 ))
then
chart MORE1 "Graph MORE1 Title" 0
fi
if (( hasMORE3 ))
then
chart MORE3 "Graph MORE3 Title" 0
fi
# CPU_USE
chart_start CPU_USE
$ECHO "['CPU','User%','System%']"
grep "^CPU[0-9]*,T" $INPUT | awk -F, '
{
count[$1] += 1;
usr[$1] += $3;
sys[$1] += $4;
}
END {
for (i in usr) {
printf "%s %.1f %.1f\n", i, usr[i]/count[i], sys[i]/count[i]
}
}' | sed -e 's/CPU//' | sort -n | awk '{
printf ",['\''CPU%s'\'',%.1f,%.1f]\n", $1, $2, $3
}'
chart_end_column CPU_USE "Use of Logical CPU Core Threads - POWER=SMT or x86=Hyperthreads" 1
if (( hasDISKBUSY1 ))
then
# TOPSUM Buble chart of CPU, I/O and RAM use
chart_start TOPDISK
export DISKBUSY=/tmp/DISKBUSY.$$
export DISKTMP1=/tmp/DISKTMP1.$$
export DISKTMP2=/tmp/DISKTMP2.$$
export DISKALL=/tmp/DISKALL.$$
export DISK20=/tmp/DISK20.$$
#extract all disks busy lines
grep ^DISKBUSY $INPUT >$DISKBUSY
#extract the zeroth disks busy lines as the base data
grep ^DISKBUSY, $DISKBUSY >$DISKALL
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
do
grep ^DISKBUSY$i, $DISKBUSY | cut -d "," -f 3- >$DISKTMP2
# if file zero bytes in length = we have processes all the DISKBUSYn lines
if [ ! -s $DISKTMP2 ]
then
break
fi
cp $DISKALL $DISKTMP1
paste -d, $DISKTMP1 $DISKTMP2 >$DISKALL
done
columns=$(cat $DISKALL | awk -F , '{ for (i=1;i<=NF;i++) sum[i]+=$i;};
END { for(i in sum) print sum[i] " " i; }' | sort -nr | head -15 | cut -d " " -f 2 | awk '{ printf ","$1}')
cut -d "," -f 1,2$columns <$DISKALL >$DISK20
# Generate the JaveScript data Array
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKBUSY,D $DISK20 | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKBUSY,T $DISK20 | sed -e "s/DISKBUSY,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end TOPDISK "Top 15 disks by sum(Busy%)" 0
fi
if (( hasTOP ))
then
# TOPSUM Buble chart of CPU, I/O and RAM use
chart_start TOPSUM
# output the fixed header line
$ECHO "['Command', 'CPU seconds', 'CharIO', 'Type', 'Memory KB' ]"
# extract filter out the rubish out particularly for command names
grep "^TOP,[0-9]" $INPUT | sed -e "s/[ =<>\[\]-+\/:]/_/g" >$TOP
cat $TOP | awk -F, '
{
cpu[$14] += $4;
io[$14] += $11;
size[$14] = (size[$14] < ($9 + $10) ? ($9 + $10) : size[$14] );
}
END {
for (i in cpu) {
printf ",['\''%s'\'',%8.1f,%8d,'\''%s'\'',%8d]\n", i, cpu[i], io[i] / 1024, i, size[i]
}
}' | sort -rn $SORTARG | head -n 20 >>$TOP20
cat $TOP20
chart_end_top
# TOP processes over time chart
awk -F\' '
BEGIN {
i=1 ;
printf "BEGIN {\n" ;
}
{
printf "\tcmd[%d]=\"%s\";\n", i, $2 ;
i++ ;
}' <$TOP20 >$TOPAWKS
$ECHO '
}
{
timestamp[$3]=$3;
cpu[$3 "_" $14] += $4;
}
END {
for (j in cmd) {
printf ",'\''%s'\''", cmd[j];
}
printf "]\\n" ;
for (i in timestamp) {
printf ",['\''%s'\''", i;
for (j in cmd) {
printf ", %.1f", cpu[i "_" cmd[j]] ;
}
printf "]\\n" ;
}
}' >>$TOPAWKS
# Now execute the dynamically created awk script
chart_start TOPCMD
$PRINTN "[{type: 'datetime', label: 'Datetime' }"
cat $TOP | awk -F, -f $TOPAWKS | sort -n
chart_end TOPCMD "Top Process Commands by CPU (Percentage of a CPU core)" 0
fi
# These lines have different numbers of stats depending on the machine config
# Assuming we want all the stats on a line then fortunately we just need to format them
chart_start NET
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^NET,N $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^NET,T $INPUT | \
awk -F"," '{printf(",['\''%s'\''",$2); for(i=3; i<=NF; i++){if( i<=(((NF-2)/2+2)) ){printf(",%.1f",$i)} else {printf(",-%.1f",$i)}};printf("]\n")}'
chart_end NET "Network Receive(read) & Send(write shown negatively) in KB per second" 0
chart_start NETPACKET
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^NETPACKET,N $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^NETPACKET,T $INPUT | sed -e "s/NETPACKET,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end NETPACKET "Network packet count per second" 0
if (( isAIX ))
then
if (( hasNETSIZE ))
then
chart_start NETSIZE
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^NETSIZE,N $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^NETSIZE,T $INPUT | sed -e "s/NETSIZE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end NETSIZE "Network packet size (bytes)" 0
fi
fi
#--
if (( isAIX ))
then
chart_start ADAPT_KBS
grep ^IOADAPT,D $INPUT | \
awk -F"," '{printf("[{type: '\''datetime'\'', label: '\''Datetime'\'' }"); for(i=3; i<=NF; i++){if( ((i+1)%3) || i<1 ){printf(",'\''%s'\''",$i)}}; printf("]\n")}'
grep ^IOADAPT,T $INPUT | \
awk -F"," 'NR!=1{printf(",['\''%s'\''",$2); for(i=3; i<=NF; i++){if( ((i+1)%3) || i<1 ){printf(",%.1f",$i)}};printf("]\n")}'
chart_end ADAPT_KBS "I/O Adapter stats in KB per second (Stacked)" 1
fi
#---
if (( isAIX ))
then
chart_start ADAPT_TPS
grep ^IOADAPT,D $INPUT | \
awk -F"," '{printf("[{type: '\''datetime'\'', label: '\''Datetime'\'' }"); for(i=5; i<=NF; i++){if( !((i+1)%3) || i<1 ){printf(",'\''%s'\''",$i)}}; printf("]\n")}'
grep ^IOADAPT,T $INPUT | \
awk -F"," 'NR!=1{printf(",['\''%s'\''",$2); for(i=5; i<=NF; i++){if( !((i+1)%3) || i<1 ){printf(",%.1f",$i)}};printf("]\n")}'
chart_end ADAPT_TPS "I/O Adapter stats in Transfers per second (Stacked)" 1
fi
if (( isAIX ))
then
if (( hasFC ))
then
chart_start FCREAD
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^FCREAD,F $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^FCREAD,T $INPUT | sed -e "s/FCREAD,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end FCREAD "Fibre Channel Read KB/s" 0
chart_start FCWRITE
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^FCWRITE,F $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^FCWRITE,T $INPUT | sed -e "s/FCWRITE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end FCWRITE "Fibre Channel Write KB/s" 0
chart_start FCXFERIN
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^FCXFERIN,F $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^FCXFERIN,T $INPUT | sed -e "s/FCXFERIN,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end FCXFERIN "Fibre Channel transers In/s" 0
chart_start FCXFEROUT
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^FCXFEROUT,F $INPUT | cut -f 3- -d, | sed -e "s/,$//" -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^FCXFEROUT,T $INPUT | sed -e "s/FCXFEROUT,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end FCXFEROUT "Fibre Channel transers Out/s" 0
fi
fi
#--- next the disks graphs that have Stacked and Unstacked versions
# handles diskless servers
if (( hasDISKs ))
then
chart_start DISKBUSY
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKBUSY,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKBUSY,T $INPUT | sed -e "s/DISKBUSY,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKBUSY "Disk Busy Percentage of the time (Stacked)" 1
chart_add_unstacked DISKBUSY "Disk Busy Percentage of the time (UnStacked)"
chart_start DISKREAD
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKREAD,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKREAD,T $INPUT | sed -e "s/DISKREAD,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKREAD "Disk Read KB per second (Stacked)" 1
chart_add_unstacked DISKREAD "Disk Read KB per second (UnStacked)"
chart_start DISKWRITE
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKWRITE,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKWRITE,T $INPUT | sed -e "s/DISKWRITE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKWRITE "Disk Write KB per second (Stacked)" 1
chart_add_unstacked DISKWRITE "Disk Write KB per second (UnStacked)"
chart_start DISKBSIZE
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKBSIZE,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKBSIZE,T $INPUT | sed -e "s/DISKBSIZE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKBSIZE "Disk Block Size KB" 0
chart_start DISKXFER
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKXFER,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKXFER,T $INPUT | sed -e "s/DISKXFER,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKXFER "Disk Transfers per second" 0
fi
# end of hasDISKs
if(( hasSERVICETIME ))
then
chart_start DISKSERV
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKSERV,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKSERV,T $INPUT | sed -e "s/DISKSERV,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKSERV "Disk Service Time in milli-seconds" 0
chart_start DISKREADSERV
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKREADSERV,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKREADSERV,T $INPUT | sed -e "s/DISKREADSERV,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKREADSERV "Disk Read Service Time in milli-seconds" 0
chart_start DISKWRITESERV
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKWRITESERV,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKWRITESERV,T $INPUT | sed -e "s/DISKWRITESERV,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKWRITESERV "Disk Write Service Time in milli-seconds" 0
chart_start DISKWAIT
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DISKWAIT,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DISKWAIT,T $INPUT | sed -e "s/DISKWAIT,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DISKWAIT "Disk Wait Time in milli-seconds" 0
fi
if (( hasDG ))
then
chart_start DGBUSY
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DGBUSY,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DGBUSY,T $INPUT | sed -e "s/DGBUSY,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DGBUSY "Disk Group Busy Percentage of the time (Stacked)" 1
chart_add_unstacked DGBUSY "Disk Group Busy Percentage of the time (UnStacked)"
chart_start DGREAD
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DGREAD,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DGREAD,T $INPUT | sed -e "s/DGREAD,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DGREAD "Disk Group Read KB per second (Stacked)" 1
chart_add_unstacked DGREAD "Disk Group Read KB per second (UnStacked)"
chart_start DGWRITE
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DGWRITE,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DGWRITE,T $INPUT | sed -e "s/DGWRITE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DGWRITE "Disk Group Write KB per second (Stacked)" 1
chart_add_unstacked DGWRITE "Disk Group Write KB per second (UnStacked)"
chart_start DGSIZE
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DGSIZE,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DGSIZE,T $INPUT | sed -e "s/DGSIZE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DGSIZE "Disk Group Block Size KB" 0
chart_start DGXFER
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^DGXFER,D $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^DGXFER,T $INPUT | sed -e "s/DGXFER,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/"
chart_end DGXFER "Disk Group Transfers per second" 0
fi
if (( hasJFS ))
then
chart_start JFS
$PRINTN "[{type: 'datetime', label: 'Datetime' },'"
grep ^JFSFILE,J $INPUT | cut -f 3- -d, | sed -e "s/,/\',\'/g" -e "s/\$/\\']/"
grep ^JFSFILE,T $INPUT | sed -e "s/JFSFILE,/#\[\'/" -e "s/,/\',/" -e "s/\$/\\]/" -e "s/#/,/" -e "s/-nan/-1.234/g"
chart_end JFS "Journal File System Percent Full (Note: -1.234 = stats not avaialble)" 0
fi
if (( isAIX ))
then
chart IPC "InterProcess Comms - Semaphores per second & Message Queues send per seconds" 0
fi
html_mid
if (( isAIX ))
then
if (( hasLPARstats ))
then
chart_button PHYSICAL_CPU "Physical CPU" black
chart_button POOLIDLE "Pool Idle" black
fi
chart_button CPU_UTIL "CPU Util." red
chart_button CPU_USE "CPU Use" red
chart_button RUNQ "RunQ" red
if (( hasPROCCOUNT ))
then
chart_button PROCCOUNT "Procs" red
fi
chart_button PSWITCH "pSwitch" red
chart_button SYSCALL "SysCall" red
chart_button READWRITE "ReadWrite" red
chart_button FORKEXEC "ForkExec" red
chart_button FILEIO "File I/O" red
chart_button REALMEM "Real Mem" blue
chart_button VIRTMEM "Virt Mem" blue
chart_button FSCACHE "FS Cache" blue
chart_button MEMNEW "MemUse" blue
chart_button PAGING "Paging" blue
chart_button SWAPIN "Swaping " blue
$ECHO '<br>'
# This is in the AIX section
if (( hasMORE1 ))
then
chart_button MORE1 "MORE1" red
fi
if (( hasMORE3 ))
then
chart_button MORE3 "MORE3" red
fi
chart_button NET "Network" purple
chart_button NETPACKET "Net Packets" purple
if (( hasNETSIZE ))
then
chart_button NETSIZE "Net Size" purple
fi
chart_button ADAPT_KBS "Adapter KBs" green
chart_button ADAPT_TPS "Adapter Tps" green
if (( hasFC ))
then