咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
Linux 磁盘压力测试脚本
蓝队云小课堂:
以下两个脚本是关于磁盘测试的
需要安装hdparm
#!/bin/bash
declare -a num1[k];
declare -a num2[k];
for k in `seq 1 $1`
do
num1[k]=`hdparm -t "$2" | sed -n '3p' | awk -F " " '{print $11}'`
num2[k]=`hdparm -t "$2" | sed -n '3p' | awk -F " " '{print $8}'`
#num[k]=$k
echo ${num1[k]}
echo ${num2[k]}
done
#declare -i arg=0
for i in `seq 1 $1`
do
arg1=`awk 'BEGIN{print '$arg1+${num1[i]}'}'`
arg2=`awk 'BEGIN{print '$arg2+${num2[i]}'}'`
#echo $arg
done
echo "average value:"
awk 'BEGIN{print '$arg1/$1'}'
echo "time value:"
awk 'BEGIN{print '$arg2/$1'}'
#!/bin/bash
declare -a num1[k];
for k in `seq 1 $1`
do
num1[k]=`hdparm -t "$2" | sed -n '3p' | awk -F " " '{print $11}'`
echo ${num1[k]}
done
更多小知识,可联系蓝队云一起探讨。