disk space monitor
#!/bin/bash
space=$(df -h | awk '{print $5}' | awk 'NR==2')
disk=${space:0:2}
count=100
if [ $disk -gt 80 ]
then
echo "$(df -h )
$(date)" | mail -s " Warning disk is full " ambiorixg12@gmail.com
else
echo "Disk space OK $(df -h )
$(date)"
echo "$(df -h )
$(date)" | mail -s " Disk space report " ambiorixg12@gmail.com
fi
@daily /root/monitor.sh > /root/disk-results.txt 2> /root/disk-errror.tx
0 comentarios:
Publicar un comentario
Suscribirse a Enviar comentarios [Atom]
<< Inicio