forked from vlibertucci/perfinsights
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathperfinsights.sh
More file actions
executable file
·1776 lines (1595 loc) · 63.9 KB
/
perfinsights.sh
File metadata and controls
executable file
·1776 lines (1595 loc) · 63.9 KB
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
#!/bin/bash
############################################
# PerfInsight for Linux systems
# By: Guillaume Ducroix & Vincent Bastianon
#
#######
#
# Script used to test performances on Linux Azure virtual machines
#
#
####### Supported Linux distributions
#
# CentOS 6.8, 7.1, 7.2
# Ubuntu 14.04, 16.04
# RHEL 6.8, 7.2, 7.3
# SLES 12SP1
# Debian 7, 8
#
####### Requirements/Limits
#
# Requires an internet connection to install required software (epel, sysstat, iotop and fio)
# Supports MDADM RAIDs
#
####### Versions
#
# 1.0 - 2016-05-24 - Initial version
# 1.1 - 2016-05-25 - Devices information gathering
# 1.2 - 2016-05-26 - Tests optimization (warm-up phase and several runs)
# 1.3 - 2016-11-04 - Support RedHat
# 1.4 - 2016-11-07 - Script enhancements
# 1.5 - 2016-11-09 - RHEL 6.8, 7.2, 7.3
# 1.6 - 2016-11-10 - SLES 12SP1
# 1.7 - 2016-11-10 - Debian in progress
# 1.8 - 2016-11-14 - Ubuntu 16.04, CentOS 6.8
# 1.9 - 2016-11-15 - Debian 7, Debian 8
# 2.0 - 2016-11-15 - Oracle Linux in progress
# 3.0 - 2016-11-24 - Perfinsights branch
# 3.1 - 2016-11-29 - Adding bench tuning
# 3.2 - 2017-01-24 - Arguments handling and fixes
# 3.3 - 2017-01-25 - Archive output logs
# 3.4 - 2017-02-02 - General counter collection with sysstat
# 3.5 - 2017-04-06 - Added "pointintime" scenario
#
####### To do
#
# * Collect data and output as Windows version
# * Identify LUNs: ls -l /sys/block/*/device
# * Identify kind of RAID
# * Identify disk layout
#
####### To do
#
# * CPU clock incorrect on CentOS 6.8, 7.20
#
####### Resources
#
# * https://azure.microsoft.com/en-us/documentation/articles/azure-subscription-service-limits/#storage-limits
# * FIO for red hat: http://dag.wieers.com/rpm/packages/fio/
# * http://brick.kernel.dk/snaps/
# * https://pkgs.org
# * FreeBSD https://www.cyberciti.biz/faq/freebsd-hard-disk-information/
#
############################################
# Constants
SCRIPTVERSION=3.5
SCRIPT=`realpath $0`
SCRIPTPATH=${PWD} #`dirname $SCRIPT`
BLUE='\034[0;34m'
RED='\033[0;31m'
# Global variables
global_executiondatetime=$(date +%Y-%m-%d_%H-%M-%S)
global_outputpath=$SCRIPTPATH/log_perfinsight_$global_executiondatetime
global_fioversion=fio-2.8
global_fiopath=mstemp/$global_fioversion
global_sysstatversion=sysstat-11.4.3
global_arg_scenario=''
global_arg_forceprompts=n
global_arg_skipdisks=n
global_bypasssystemdisk=n
global_bypasstempdisk=n
global_arg_repro=n
global_arg_samples=0
global_arg_interval=1
global_arg_debug=n
global_distro=""
global_distroversion=""
global_vmsize=""
global_targetvolume=""
#declare -a global_disklist=($*)
declare -a global_disklist
#declare -a global_volumelist=($*)
declare -a global_volumelist
global_currentcount=3
global_threadnumber=1
global_vmmaxiops=0
global_vmmaxthroughput=0
global_vmstoragetier=""
##### Libraries
#source ./TECHNIQUES.source
##### Functions
DisplayOutput(){
local arg_texttodisplay=$1
local arg_display=$2
local arg_header=$3
local arg_logtofile=$4
#echo $arg_texttodisplay $arg_display $arg_logtofile > /dev/stderr
local lcurrenttime=$(date +%Y-%m-%d_%H:%M:%S)
if [ $arg_display -eq 1 ];then
if [[ ! -z $arg_texttodisplay ]];then
if [[ "$arg_texttodisplay" == "> "* ]];then
echo -ne "\e[34m"
fi
if [[ "$arg_texttodisplay" == ">> "* ]];then
echo -ne "\e[94m"
fi
if [[ "$arg_texttodisplay" == ">>> "* ]];then
echo -ne "\e[36m"
fi
case $arg_header in
0)
echo -n;;
1)
echo -ne "\e[31m";;
2)
echo -ne "\e[32m";;
3)
echo -ne "\e[33m";;
*)
echo -n;;
esac
echo $arg_texttodisplay > /dev/stderr
if [ ! -z $arg_logtofile ];then
echo "$lcurrenttime | $arg_texttodisplay" >> $arg_logtofile
fi
echo -ne "\033[0m"
else
echo "" >> $arg_logtofile
fi
fi
}
DisplayUsage(){
echo "" > /dev/stderr
echo "PerfInsight for Linux $SCRIPTVERSION" > /dev/stderr
echo "" > /dev/stderr
echo "Usage: $0 [-s] [-k] [-h] [-f] [-r|-a N] [-i N]" > /dev/stderr
echo " "
echo -e "-s|--scenario \t\t [pointintime,diskinfo|diskbenchmark|slowanalysis] (PerfInsight scenario)" > /dev/stderr
echo -e "-k|--skip \t\t [system|temp|all] (skip system and/or temp disks diskbenchmark)" > /dev/stderr
echo -e "-f|--force \t\t (force, bypass all prompts)" > /dev/stderr
echo -e "-a|--samples N \t\t (slowanalysis scenario, specify number of samples to collect), best used with -i" > /dev/stderr
echo -e "-i|--interval N \t (slowanalysis scenario, specify interval between samples in seconds), best used with -a" > /dev/stderr
echo -e "-r|--repro \t\t (slowanalysis scenario, used to capture metrics during a slow behavior scenario and let user stop it), can be used with -i but not with -a" > /dev/stderr
echo -e "-h|--help \t\t Usage" > /dev/stderr
echo "" > /dev/stderr
echo -e "**** Examples ****" > /dev/stderr
echo "" > /dev/stderr
echo -e "Collect point in time VM status/performance and configuration" > /dev/stderr
echo -e "\t $0 -s poinintime" > /dev/stderr
echo "" > /dev/stderr
echo -e "Run disk benchmark on all disks" > /dev/stderr
echo -e "\t $0 -s diskbenchmark" > /dev/stderr
echo "" > /dev/stderr
echo -e "Run disk benchmark on all disks except OS disk" > /dev/stderr
echo -e "\t $0 -s diskbenchmark -k system" > /dev/stderr
echo "" > /dev/stderr
echo -e "Run slow analysis counter collection for a period of 5 minutes with a sample interval of 5 seconds:" > /dev/stderr
echo -e "\t $0 -s slowanalysis -a 60 -i 5" > /dev/stderr
echo "" > /dev/stderr
echo -e "Run slow analysis counter collection when reproducing a slow behavior with a sample interval of 2 seconds:" > /dev/stderr
echo -e "\t $0 -s slowanalysis -r -i 2" > /dev/stderr
echo "" > /dev/stderr
exit
}
OutputDataToFile(){
local arg_texttodisplay=$1
local arg_logtofile=$2
echo $arg_texttodisplay >> $arg_logtofile
}
VerifyUserInput(){
local arg_text=$1
local lresultvar=$2
local linput=''
echo "" > /dev/stderr
echo -en "\e[91m $arg_text " > /dev/stderr
#read -n 1 linput
while [[ "$linput" != "y" && "$linput" != "n" ]]
do
read -n 1 linput
done
echo -e "\033[0m"
echo "" > /dev/stderr
#echo "'$linput' .................;;" > /dev/stderr
eval $lresultvar="'$linput'"
}
IsOSSupported(){
which python > /dev/null 2>&1
python_status=`echo $?`
if [ "$python_status" -eq 0 ]; then
global_distro=`python -c 'import platform ; print platform.dist()[0]'`
else
global_distro=$(awk '/DISTRIB_ID=/' /etc/*-release | sed 's/DISTRIB_ID=//' | tr '[:upper:]' '[:lower:]')
fi
case $global_distro in
redhat)
echo -n;;
Ubuntu)
echo -n;;
centos)
echo -n;;
SuSE)
echo -n;;
debian)
echo -n;;
oracle)
echo -n;;
*)
DisplayOutput " ~ This distribution ($global_distro) is not supported by this script." 1 0 $global_outputpath/perfinsights.log
exit;;
esac
global_distroversion=`cat /etc/*release | grep VERSION_ID= | grep -Eo '[0-9]+(\.{0,1})([0-9]+){0,1}'`
if [ -z $global_distroversion ];then
global_distroversion=`cat /etc/*release | grep "Red Hat Enterprise Linux Server release" | grep -Eo '[0-9]+(\.{0,1})([0-9]+){0,1}' | head -n 1`
fi
if [ -z $global_distroversion ];then
global_distroversion=`cat /etc/*release | grep "CentOS release" | grep -Eo '[0-9]+(\.{0,1})([0-9]+){0,1}'`
fi
}
TestModule(){
local modulename=$1
local moduleversion=$2
local lresult=1
if [ -z $moduleversion ]; then
case $global_distro in
redhat)
yum list installed $modulename > /dev/null 2>&1
lresult=`echo $?`
#if [ $lresult -ne 0 ]; then
# find ./ -name $modulename > /dev/null 2>&1
# lresult=`echo $?`
#fi
if [ $lresult -ne 0 ]; then
which $modulename > /dev/null 2>&1
lresult=`echo $?`
fi;;
Ubuntu)
#apt list $modulename > /dev/null 2>&1
#dpkg-query --list $modulename > /dev/null 2>&1
#lresult=`echo $?`
ltempresult=`dpkg-query -l $modulename | tail -n 1 | awk '{print $1}'` > /dev/null 2>&1
if [[ "$ltempresult" == "ii" ]]; then
lresult=0
fi;;
centos)
yum list installed $modulename > /dev/null 2>&1
lresult=`echo $?`;;
SuSE)
#yast2 $modulename > /dev/null 2>&1
#zypper search -i -n $modulename
rpm -q $modulename > /dev/null 2>&1
lresult=`echo $?`;;
debian)
dpkg -l | grep $modulename > /dev/null 2>&1
lresult=`echo $?`;;
oracle)
yum list installed $modulename > /dev/null 2>&1
lresult=`echo $?`;;
*)
esac
else
if [ -d "$moduleversion" ]; then
lresult=0
fi
fi
echo $lresult
}
GetTempDisk(){
local arg_size=$1
local arg_sizewithunit=$2
local ltempdisk
local ltempdisksize
# swapon -s
for ldevice in $(df -h | awk '{print $1}' | grep /dev/)
do
for lvolume in $(df -h | grep $ldevice | awk '{print $6}')
do
if [ -e $lvolume/DATALOSS_WARNING_README.txt ];then
ltempdisk=$lvolume
break
fi
done
done
local lresult=''
if [ $arg_size -eq 0 ];then
if [ $arg_sizewithunit -eq 1 ];then
lresult=`df | grep -w $ltempdisk | awk '{print $1}'`
else
lresult=$ltempdisk
fi
elif [ $arg_size -eq 1 ];then
if [ $arg_sizewithunit -eq 0 ];then
ltempdisksize=`df | grep $ltempdisk | awk '{print $4}'`
else
ltempdisksize=`df -h | grep $ltempdisk | awk '{print $4}'`
fi
#ltempdisksize+="G"
lresult=$ltempdisksize
fi
echo $lresult
}
GetVMInfo(){
DisplayOutput "" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-----------------------------------------" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "> Virtual Machine" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-----------------------------------------" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "" 0 0 $global_outputpath/perfinsights.log
lrefvmsize=""
lcores=`lscpu | grep "CPU(s):" | grep -Eo '([0-9]+)' | head -n 1`
lcpuclock=`lscpu | grep MHz | grep -Eo '([0-9]){3}' | sed ':a;s/\B[0-9]\{2\}\>/.&/;ta' | head -n 1`
lmemory=`awk '/MemTotal/ {print $2}' /proc/meminfo | awk '{$1=($1+1023)/1024/1024;printf "%.2f\n",$1}'`
ltempdisk=`GetTempDisk 0 0`
ltempvolume=`GetTempDisk 0 1`
ltempdisksize=`GetTempDisk 1 1`
OIFS=$IFS
IFS=";"
while IFS='' read -r line || [[ -n "$line" ]]; do
set -- "$line"
declare -a sizeArray=($*)
lrefcores=${sizeArray[5]}
if [[ "$lrefcores" != "CPU Cores" ]]; then
lrefmemory=${sizeArray[6]}
lreftempsize=${sizeArray[7]}
lrefcpuclock=${sizeArray[8]}
if [[ "$lrefcores" == "$lcores" ]]; then
#echo "$lrefcores - $lrefmemory - $lreftempsize - $lrefcpuclock" > /dev/stderr
if [[ "$lrefcpuclock" == "$lcpuclock" ]]; then
if [[ "$lrefmemory" = "$lmemory" ]]; then
if [[ "$lreftempsize" == "$ltempdisksize" ]]; then
global_vmsize=${sizeArray[0]}
break
fi
fi
fi
fi
fi
done < ./linuxvmsizes.csv
IFS=$OIFS
if [ -z $global_vmsize ];then
DisplayOutput "-> Virtual machine size could not be identified" 1 0 $global_outputpath/perfinsights.log
else
DisplayOutput "-> Size: $global_vmsize" 1 0 $global_outputpath/perfinsights.log
fi
DisplayOutput "-> Core(s): $lcores" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-> CPU clock: $lcpuclock MHz" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-> Memory: $lmemory GB" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-> Temp disk: $ltempdisk (volume: $ltempvolume)" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-> Temp disk size: $ltempdisksize" 1 0 $global_outputpath/perfinsights.log
if [ ! -z $global_vmsize ];then
OIFS=$IFS
IFS=";"
while IFS='' read -r line || [[ -n "$line" ]]; do
set -- "$line"
declare -a slaArray=($*)
lrefvmsize=${slaArray[0]}
if [[ "$lrefvmsize" = "$global_vmsize" ]]; then
global_vmmaxiops=${slaArray[6]}
global_vmmaxthroughput=${slaArray[7]}
global_vmstoragetier=${slaArray[14]}
global_vmstoragetier=${global_vmstoragetier/[^[:alnum:]]/}
break
fi
done < ./linuxvmslas.csv
IFS=$OIFS
DisplayOutput "-> Max IOPS: $global_vmmaxiops" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-> Max throughput: $global_vmmaxthroughput" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-> Storage tier: $global_vmstoragetier" 1 0 $global_outputpath/perfinsights.log
fi
}
GetSystemInformation(){
DisplayOutput "" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-----------------------------------------" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "> Gather system informations" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-----------------------------------------" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "-> Linux distribution: $global_distro $global_distroversion" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "" 0 0 $global_outputpath/perfinsights.log
cat /etc/*release >> $global_outputpath/perfinsights.log
echo "uname -a " >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
echo -n "uptime: " >> $global_outputpath/perfinsights.log
uptime >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
echo "LAD version: " >> $global_outputpath/perfinsights.log
waagent --version >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
lsmod >> $global_outputpath/perfinsights.log
echo "----------------------------------------- " >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
modinfo hv_storvsc >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
echo "----------------------------------------- " >> $global_outputpath/perfinsights.log
modinfo hv_netvsc >> $global_outputpath/perfinsights.log
echo "----------------------------------------- " >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
modinfo hv_utils >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
echo "----------------------------------------- " >> $global_outputpath/perfinsights.log
modinfo hv_vmbus >> $global_outputpath/perfinsights.log
echo "" >> $global_outputpath/perfinsights.log
}
FindLVMVolGroupFromMountPoint(){
local lvolume=$1
local lresultvar=$2
local lvolgroup=''
df -h | grep -w $lvolume | grep /dev/mapper > /dev/null 2>&1
local lresult=`echo $?`
if [[ $lresult -eq 0 ]];then
local testvar=`df -h | grep -w $lvolume | grep /dev/mapper | awk -F / '{print $4}' | awk '{print $1}'`
if [[ "$testvar" == *"--"* ]];then
testvar="${testvar/--/-}"
DisplayOutput " ~ Volume has a - in the name: $testvar" 1 0 $global_outputpath/perfinsights.log
else
lvolgroup=`echo $(df -h | grep -w $lvolume | grep /dev/mapper | awk -F / '{print $4}' | awk '{print $1}' | awk -F "-" '{print $1}')` #> /dev/null 2>&1
## logvol=`df -h | grep -w $volume | grep /dev/mapper | awk -F - '{print $2}' | awk '{print $1}'`
fi
fi
eval $lresultvar="'$lvolgroup'"
}
######## FIND THE LVPATH of an existing FS. Query the lvm using FS' mount point
fileSystem_to_lvPath(){
FS_TO_QUERY=$1
#Call like this: $0 /tmp
#Relevant commands for debug: blkid, lsblk, dmsetup, lvdisplay, lvs
#OLD Solution: DEV_MAPPER=$(df -l --output=source $1 | awk '{print $1}' | cut -d"/" -f 4 | tail -1)
#Find DeviceMapper_MajorMinorNumber for specific fs
DeviceMapper_MajorMinorNumber=$(lsblk --noheadings --output TYPE,MAJ:MIN,MOUNTPOINT | grep -w lvm | grep -w $FS_TO_QUERY | awk '{print $2}')
#VG=$(lvs --noheadings --separator : --options lv_kernel_major,lv_kernel_minor,vg_name,lv_name,lv_path | grep $DeviceMapper_MajorMinorNumber | awk -F : '{print $3}')
#LV=$(lvs --noheadings --separator : --options lv_kernel_major,lv_kernel_minor,vg_name,lv_name,lv_path | grep $DeviceMapper_MajorMinorNumber | awk -F : '{print $4}')
LV_PATH=$(lvs --noheadings --separator : --options lv_kernel_major,lv_kernel_minor,vg_name,lv_name,lv_path | grep $DeviceMapper_MajorMinorNumber | awk -F : '{print $5}')
echo $LV_PATH
#echo "$VG/$LV"
}
######## FIND THE FS (and FS' mountpoint) of an existing LVPATH:
lvPath_to_fileSystem(){
LV_PATH=$1
#Call like this: $0 /dev/vg00/opt
#Relevant commands for debug: blkid, lsblk, dmsetup, lvdisplay, lvs
#OLD Solution: DEV_MAPPER=$(df -l --output=source $1 | awk '{print $1}' | cut -d"/" -f 4 | tail -1)
#Find DeviceMapper_MajorMinorNumber for specific lv_path
DeviceMapper_MajorMinorNumber=$(lvs --noheadings --separator : --options lv_kernel_major,lv_kernel_minor,vg_name,lv_name,lv_path | grep $LV_PATH | awk -F : '{print $1":"$2}')
FS=$(lsblk --noheadings --output TYPE,MAJ:MIN,MOUNTPOINT | grep -w lvm | grep -w $DeviceMapper_MajorMinorNumber | awk '{print $3}')
echo $FS
}
GetSCSIPath(){
local arg_device=$1
local arg_pathsegment=$2
local lresult=-1
local deviceid=`echo $arg_device | awk -F / '{print $3}'`
case $arg_pathsegment in
SCSIBus)
lresult=`ls -l /sys/block/*/device | grep $deviceid | awk '{print $11}' | awk -F / '{print $4}' | awk -F : '{print $1}'`;;
SCSILun)
lresult=`ls -l /sys/block/*/device | grep $deviceid | awk '{print $11}' | awk -F / '{print $4}' | awk -F : '{print $2}'`;;
SCSIPort)
lresult=`ls -l /sys/block/*/device | grep $deviceid | awk '{print $11}' | awk -F / '{print $4}' | awk -F : '{print $3}'`;;
TargetID)
lresult=`ls -l /sys/block/*/device | grep $deviceid | awk '{print $11}' | awk -F / '{print $4}' | awk -F : '{print $4}'`;;
esac
echo $lresult
}
GetDiskSpindles(){
local arg_volume=$1
local lspindles=1
local lresult=$(TestModule mdadm)
if [[ $lresult -eq "0" ]]; then
local ldevice=`df -h | grep -w $arg_volume | awk '{print $1}'`
mdadm --detail $ldevice > /dev/null 2>&1
lresult=`echo $?`
if [[ $lresult -eq 0 ]];then
lspindles=`mdadm --detail $ldevice | grep "Active Devices" | awk '{print $4}'`
fi
fi
lresult=$(TestModule lvm*)
if [[ $lresult -eq "0" ]]; then
vgdisplay $arg_volume > /dev/null 2>&1
lresult=`echo $?`
if [[ $lresult -eq 0 ]];then
lspindles=`vgdisplay $arg_volume | grep "Metadata Areas" | awk '{print $3}'`
fi
fi
echo $lspindles
}
DisplayDiskInformation(){
local lresult=''
local lcount=0
DisplayOutput "" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-----------------------------------------" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "> Disks information" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "-----------------------------------------" 0 0 $global_outputpath/perfinsights.log
DisplayOutput "" 0 0 $global_outputpath/perfinsights.log
DisplayOutput ">> List disks" 1 0 $global_outputpath/perfinsights.log
for ldisk in $(fdisk -l | awk '$1=="Disk" && $2 ~ /^\/dev\/.*/ {print $2}')
do
if [[ "$ldisk" != "/dev/ram"* ]];then
global_disklist[$lcount]=${ldisk/":"/""}
ldevice=${ldisk/":"/""}
DisplayOutput "--> $ldevice" 1 0 $global_outputpath/perfinsights.log
((lcount++))
fi
done
DisplayOutput ">> Get mount information" 1 0 $global_outputpath/perfinsights.log
mount -l >> $global_outputpath/perfinsights.log
fdisk -l >> $global_outputpath/perfinsights.log
DisplayOutput ">> Get parted information" 1 0 $global_outputpath/perfinsights.log
parted -l >> $global_outputpath/perfinsights.log > /dev/null 2>&1
DisplayOutput ">> Get blkid information" 1 0 $global_outputpath/perfinsights.log
blkid >> $global_outputpath/perfinsights.log
DisplayOutput ">> Get lsblk information" 1 0 $global_outputpath/perfinsights.log
lsblk >> $global_outputpath/perfinsights.log
DisplayOutput ">> List volumes" 1 0 $global_outputpath/perfinsights.log
lcount=0
for ldevice in $(df -h | awk '{print $1}' | grep /dev/)
do
for lvolume in $(df -h | grep $ldevice | awk '{print $6}')
do
local lvoldevice=""
local lvolsize=""
echo "$lvolume" | grep /dev/ > /dev/null 2>&1
lresult=`echo $?`
if [[ $lresult -ne 0 ]];then
if [[ "$lvolume" = "/" ]]; then
lvoldevice=`df -h | grep -w "/" | head -n 1 | awk '{print $1}'`
else
lvoldevice=`df -h | grep "$lvolume" | awk '{print $1}'`
fi
lvolsize=`df -h | grep "$lvoldevice" | awk '{print $2}'`
global_volumelist[$lcount]=$lvolume
DisplayOutput "--> $lvolume on $lvoldevice ($lvolsize)" 1 0 $global_outputpath/perfinsights.log
((lcount++))
fi
done
done
if [ $global_distro = redhat ]; then
echo -n
#parted print all quit > $global_outputpath/info_diskinfo_parted.txt
fi
lresult=$(TestModule mdadm)
if [[ $lresult -ne "0" ]]; then
DisplayOutput "-> MDADM library is not present" 1 0 $global_outputpath/perfinsights.log
else
DisplayOutput ">> Get MDADM information" 1 0 $global_outputpath/perfinsights.log
for lvolume in "${global_volumelist[@]}"
do
lvoldevice=`df -h | grep -w $lvolume | awk '{print $1}'`
mdadm --detail $lvoldevice > /dev/null 2>&1
lresult=`echo $?`
if [[ $lresult -eq 0 ]];then
#lspindles=`mdadm --detail $lvoldevice | grep "Active Devices" | awk '{print $4}'`
lspindles=`GetDiskSpindles $lvolume`
DisplayOutput "--> $lvolume ($lvoldevice) is a mdadm volume with $lspindles spindles" 1 0 $global_outputpath/perfinsights.log
fi
done
##### TODO: test number of volumes to diplay "No LVM volume"
fi
lresult=$(TestModule lvm*)
if [[ $lresult -ne "0" ]]; then
DisplayOutput "-> LVM library is not present" 1 0 $global_outputpath/perfinsights.log
else
DisplayOutput ">> Get LVM information" 1 0 $global_outputpath/perfinsights.log
lvmdiskscan | grep "LVM physical volume" >> $global_outputpath/perfinsights.log
DisplayOutput ">>> Get physical volume(s) information" 1 0 $global_outputpath/perfinsights.log
pvs >> $global_outputpath/perfinsights.log
pvdisplay >> $global_outputpath/perfinsights.log
DisplayOutput ">>> Get volume group(s) information" 1 0 $global_outputpath/perfinsights.log
vgs >> $global_outputpath/perfinsights.log
vgdisplay >> $global_outputpath/perfinsights.log
DisplayOutput ">>> Get logical volume(s) information" 1 0 $global_outputpath/perfinsights.log
lvs >> $global_outputpath/perfinsights.log
lvdisplay >> $global_outputpath/perfinsights.log
lvdisplay -m >> $global_outputpath/perfinsights.log
DisplayOutput ">>> List LVM logical volumes" 1 0 $global_outputpath/perfinsights.log
for lvolume in "${global_volumelist[@]}"
do
#echo "$lvolume ${global_volumelist[$ltempcount]}"
df -h | grep -w $lvolume | grep /dev/mapper > /dev/null 2>&1
lresult=`echo $?`
if [[ $lresult -eq 0 ]];then
lvoldevice=`df -h | grep -w $lvolume | awk '{print $1}'`
FindLVMVolGroupFromMountPoint $lvolume llvmvolgroupname
lspindles=`GetDiskSpindles $llvmvolgroupname`
DisplayOutput "---> $lvolume ($lvoldevice) is a LVM volume group with $lspindles spindle(s)" 1 0 $global_outputpath/perfinsights.log
fi
done
##### TODO: test number of volumes to diplay "No LVM volume"
fi
}
GetDiskInformation(){
## Disk_Map
OutputDataToFile "{" $global_outputpath/Disk_Map.json
OutputDataToFile " \"diskObj\" : [" $global_outputpath/Disk_Map.json
OutputDataToFile " {" $global_outputpath/Disk_Map.json
lcount=0
for ldisk in $(fdisk -l | awk '$1=="Disk" && $2 ~ /^\/dev\/.*/ {print $2}')
do
if [[ "$ldisk" != "/dev/ram"* ]];then
global_disklist[$lcount]=${ldisk/":"/""}
ldevice=${ldisk/":"/""}
OutputDataToFile " \"DiskNumber\" : $lcount," $global_outputpath/Disk_Map.json
OutputDataToFile " \"DriveName\" : ${global_disklist[$lcount]}," $global_outputpath/Disk_Map.json
ltempvalue=`fdisk -l $ldevice | grep $ldevice | awk '{print $2}' | tail -n 1`
if [[ "$ltempvalue" == "*" ]];then
OutputDataToFile " \"IsOSDisk\" : true," $global_outputpath/Disk_Map.json
OutputDataToFile " \"IsTempDisk\" : false," $global_outputpath/Disk_Map.json
else
OutputDataToFile " \"IsOSDisk\" : false," $global_outputpath/Disk_Map.json
ltempvalue2=`GetTempDisk 0 1`
if [[ "$ltempvalue2" == "$ltempvalue" ]];then
OutputDataToFile " \"IsTempDisk\" : true," $global_outputpath/Disk_Map.json
else
OutputDataToFile " \"IsTempDisk\" : false," $global_outputpath/Disk_Map.json
fi
fi
ltempvalue=`df -h | grep $ldevice | head -n 1 | awk '{print $6}'`
OutputDataToFile " \"Letter\" : \"$ltempvalue\"," $global_outputpath/Disk_Map.json
OutputDataToFile " \"Partition\" : 0," $global_outputpath/Disk_Map.json
OutputDataToFile " \"PhysicalDiskName\" : \"${global_disklist[$lcount]}\"," $global_outputpath/Disk_Map.json
ltempvalue=`GetSCSIPath $ldevice SCSIBus`
OutputDataToFile " \"SCSIBus\" : $ltempvalue," $global_outputpath/Disk_Map.json
ltempvalue=`GetSCSIPath $ldevice SCSILun`
OutputDataToFile " \"SCSILun\" : $ltempvalue," $global_outputpath/Disk_Map.json
ltempvalue=`GetSCSIPath $ldevice SCSIPort`
OutputDataToFile " \"SCSIPort\" : $ltempvalue," $global_outputpath/Disk_Map.json
ltempvalue=`GetSCSIPath $ldevice TargetID`
OutputDataToFile " \"SCSITargetId\" : $ltempvalue," $global_outputpath/Disk_Map.json
ltempvalue=`fdisk -l $ldevice | grep $ldevice | awk '{print $2}' | tail -n 1`
if [[ "$ltempvalue" == "*" ]];then
ltempvalue=`fdisk -l $ldevice | grep $ldevice | awk '{print $6}' | tail -n 1`
else
ltempvalue=`fdisk -l $ldevice | grep $ldevice | awk '{print $5}' | tail -n 1`
fi
ltempvalue=${ltempvalue/"G"/""}
OutputDataToFile " \"SizeGB\" : $ltempvalue," $global_outputpath/Disk_Map.json
ltempvalue=`df -h | grep $ldevice | head -n 1 | awk '{print $6}'`
OutputDataToFile " \"VolumeName\" : \"$ltempvalue\"" $global_outputpath/Disk_Map.json
OutputDataToFile " }," $global_outputpath/Disk_Map.json
((lcount++))
fi
done
OutputDataToFile " ]" $global_outputpath/Disk_Map.json
OutputDataToFile "}" $global_outputpath/Disk_Map.json
## Volume_Map
OutputDataToFile "{" $global_outputpath/Volume_Map.json
OutputDataToFile " \"volumeObj\" : [" $global_outputpath/Volume_Map.json
OutputDataToFile " {" $global_outputpath/Volume_Map.json
for ldisk in $(fdisk -l | awk '$1=="Disk" && $2 ~ /^\/dev\/.*/ {print $2}')
do
OutputDataToFile "\"AllocationUnitSize\" : \"4 KB\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"ClusterSize\" : 4096," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DiskMap\" :" $global_outputpath/Volume_Map.json
OutputDataToFile "{" $global_outputpath/Volume_Map.json
OutputDataToFile "\"Boot\" : true," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DiskNumber\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DriveName\" : \"\\\\.\\PHYSICALDRIVE0\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsOSDisk\" : true," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsTempDisk\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Letter\" : \"C:\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Partition\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"PhysicalDiskName\" : \"PhysicalDisk0\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSIBus\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSILun\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSIPort\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSITargetId\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SizeGB\" : 127," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VolumeName\" : \"\"" $global_outputpath/Volume_Map.json
OutputDataToFile "}," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DiskpartVolume\" : " $global_outputpath/Volume_Map.json
OutputDataToFile "{" $global_outputpath/Volume_Map.json
OutputDataToFile "\"BitLockerEncrypted\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Disks\" : [" $global_outputpath/Volume_Map.json
OutputDataToFile "{" $global_outputpath/Volume_Map.json
OutputDataToFile "\"DiskNumber\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"FreeGB\" : 2048," $global_outputpath/Volume_Map.json
OutputDataToFile "\"HealthStatus\" : \"Online\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsDynamic\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsGpt\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"PhysicalDiskName\" : \"PhysicalDrive0\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSIBus\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSILun\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSIPort\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSITargetId\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SizeGB\" : 127" $global_outputpath/Volume_Map.json
OutputDataToFile "}" $global_outputpath/Volume_Map.json
OutputDataToFile "]," $global_outputpath/Volume_Map.json
OutputDataToFile "\"FileSystem\" : \"NTFS\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Hidden\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Info\" : \"System\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Installable\" : true," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsDynamic\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Label\" : \"\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Letter\" : \"C:\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"MountPoints\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"NoDefaultDriveLetter\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"NumberOfDisks\" : 1," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Offline\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"ReadOnly\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"ShadowCopy\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Size\" : \"126 GB\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Status\" : \"Healthy\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Type\" : \"Partition\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VolumeCapacityGB\" : \"126\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VolumeFreeSpaceGB\" : \"110\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VolumeNumber\" : 1" $global_outputpath/Volume_Map.json
OutputDataToFile "}," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Disks\" : [" $global_outputpath/Volume_Map.json
OutputDataToFile "{" $global_outputpath/Volume_Map.json
OutputDataToFile "\"DiskNumber\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"HealthStatus\" : \"Online\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"PhysicalDiskName\" : \"PhysicalDrive0\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSIBus\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSILun\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSIPort\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SCSITargetId\" : 0," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SizeGB\" : 127" $global_outputpath/Volume_Map.json
OutputDataToFile "}" $global_outputpath/Volume_Map.json
OutputDataToFile "]," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DriveType\" : 3," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DriveTypeName\" : \"LocalDisk\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"DynamicPhysicalDisks\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"FileSystem\" : \"NTFS\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"FreeGB\" : \"110.840\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"FreePerc\" : \"87.28\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsDataDisk\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsDynamic\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsMirrored\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsMountPoint\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsOSDisk\" : true," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsPartition\" : true," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsPooled\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsRAID5\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsResiliencySimple\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsSimple\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsSpanned\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsStriped\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsSystemDisk\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"IsTempDisk\" : false," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Label\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"NumOfDisks\" : 1," $global_outputpath/Volume_Map.json
OutputDataToFile "\"PooledPhysicalDisks\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"SizeGB\" : \"126.998\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"StoragePool\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"Type\" : \"Partition\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VDisk_ProvisioningType\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VDisk_ResiliencySettingName\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VirtualDisk\" : null," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VolumeID\" : \"C:\"," $global_outputpath/Volume_Map.json
OutputDataToFile "\"VolumeNumber\" : 1" $global_outputpath/Volume_Map.json
OutputDataToFile "}," $global_outputpath/Volume_Map.json
done
OutputDataToFile " ]" $global_outputpath/Volume_Map.json
OutputDataToFile "}" $global_outputpath/Volume_Map.json
}
CheckBaseToolsStatus(){
DisplayOutput "" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "----------------------------------------- " 0 $global_outputpath/perfinsights.log
DisplayOutput "> Verify presence of required tools" 1 0 $global_outputpath/perfinsights.log
DisplayOutput "----------------------------------------- " 0 $global_outputpath/perfinsights.log
DisplayOutput "" 0 0 $global_outputpath/perfinsights.log
### Verify gcc
lmodulename=''
case $global_distro in
redhat)
lmodulename=gcc;;
Ubuntu)
lmodulename=gcc;;
centos)
echo -n;;
SuSE)
echo -n;;
debian)
echo -n;;
*)
echo -n;;
esac
if [ ! -z $lmodulename ]; then
DisplayOutput ">> Verify $lmodulename" 1 0 $global_outputpath/perfinsights.log
lresult=$(TestModule $lmodulename)
if [[ $lresult -eq "0" ]]; then
DisplayOutput "--> $lmodulename already installed..." 1 0 $global_outputpath/perfinsights.log
else
DisplayOutput "--> Will download and install $lmodulename" 1 0 $global_outputpath/perfinsights.log
case $global_distro in
redhat)
yum install -y $lmodulename > /dev/null 2>&1;;
Ubuntu)
apt-get -y install $lmodulename
;;#> /dev/null 2>&1
centos)
echo -n;;
SuSE)
echo -n;;
debian)
echo -n;;
#apt get $lmodulename;;
*)
DisplayOutput "--> Not installing $lmodulename for global_distro $global_distro script exiting - this script does not run on this Linux distribution" 1 0 $global_outputpath/perfinsights.log
exit;;
esac
fi
fi
### Verify gcc
lmodulename=''
case $global_distro in
redhat)
echo -n;;
Ubuntu)
lmodulename=make;;
centos)
echo -n;;
SuSE)
echo -n;;
debian)
echo -n;;
*)
echo -n;;
esac
if [ ! -z $lmodulename ]; then
DisplayOutput ">> Verify $lmodulename" 1 0 $global_outputpath/perfinsights.log
lresult=$(TestModule $lmodulename)
if [[ $lresult -eq "0" ]]; then
DisplayOutput "--> $lmodulename already installed..." 1 0 $global_outputpath/perfinsights.log
else
DisplayOutput "--> Will download and install $lmodulename" 1 0 $global_outputpath/perfinsights.log
case $global_distro in
redhat)
echo -n;;
Ubuntu)
apt-get -y install $lmodulename
;;#> /dev/null 2>&1
centos)
echo -n;;
SuSE)
echo -n;;
debian)
echo -n;;
#apt get $lmodulename;;
*)
DisplayOutput "--> Not installing $lmodulename for global_distro $global_distro script exiting - this script does not run on this Linux distribution" 1 0 $global_outputpath/perfinsights.log
exit;;
esac
fi
fi
}
CheckDiskToolsStatus(){
### Verify libiperf0
lmodulename=''
case $global_distro in
redhat)
echo -n;;
Ubuntu)
#lmodulename=libiperf0;;
echo -n;;
centos)
echo -n;;
SuSE)
echo -n;;
debian)
echo -n;;
oracle)
echo -n;;
*)
echo -n;;
esac
if [ ! -z $lmodulename ]; then
DisplayOutput ">> Verify $lmodulename" 1 0 $global_outputpath/perfinsights.log
lresult=$(TestModule $lmodulename)
if [[ $lresult -eq "0" ]]; then
DisplayOutput "--> Will download and install $lmodulename" 1 0 $global_outputpath/perfinsights.log
apt-get -y install $lmodulename > /dev/null 2>&1
fi
fi
### Verify libaio
lmodulename=''
case $global_distro in
redhat)
lmodulename=libaio-devel;;
Ubuntu)
lmodulename=libaio1;;
centos)
lmodulename=libaio;;
SuSE)
lmodulename=libaio1;;
debian)
lmodulename=libaio1;;
*)
echo -n;;
esac