ungleich-tools/check-disks-rotational.sh

20 lines
396 B
Bash
Raw Normal View History

#!/bin/sh
if [ $# -lt 1 ]; then
echo $0: server [server...]
exit 1
fi
while [ $# -ge 1 ]; do
server=$1; shift
ssh root@$server "
cd /sys/block/
for dev in sd*; do
size=\$(fdisk -l | grep ^Disk | grep \$dev | awk '/bytes/ { print \$3 \" \" \$4 }')
printf \"${server} \${dev} \${size} rotational: \"
cat \$dev/queue/rotational
done
"
done