#!/bin/bash
threshold=60 # 设置阈值为60%
disk="/archivelog" # 目标磁盘
usage=$(df -h | grep "$disk" | awk '{print $5}') # 提取使用率
if [[ $usage > 60 ]];
then
echo "请注意" | /bin/mail -s '请注意' test@qq.com
fi
echo " notice finish"
#!/bin/bash
threshold=60 # 设置阈值为60%
disk="/archivelog" # 目标磁盘
usage=$(df -h | grep "$disk" | awk '{print $5}') # 提取使用率
if [[ $usage > 60 ]];
then
echo "请注意" | /bin/mail -s '请注意' test@qq.com
fi
echo " notice finish"