#!/bin/bash
#monitor available disk spare
SPACE=`df -h | sed -n ‘/\/$/p‘|gawk ‘{print $5}‘| sed -s ‘s/%/ /g‘`
if [ $SPACE -gt 30 ]
then
echo "192.168.2.2的磁盘空间不足30%,请管理员及时增加空间存储量" | mutt -s "192.168.2.2" [email protected]
fi
时间: 2024-10-09 22:00:56