硬盘健康状态监测

    xiaoxiao2021-09-11  338

    #!/bin/bash # 需要安装smartmontools 软件 Ip=`ifconfig | grep "inet addr:.* Bcast" | awk -F : '{print $2}'|sed -e s/Bcast//g` Disk="/dev/sd" for disk in {a..l} do smartctl -H $Disk"$disk" >>/dev/null if [ "$?" -eq "0" ];then echo "$Disk$disk Health Status: OK" else echo "$Ip---$Disk$disk Health Status: Fail"|mail -s "Disk not read" wgy.wuhan@qq.com fi done

    最新回复(0)