Bonjour
voila je suis a la recherche d'un script et/ou logiciel gratuit pouvant m'envoyer un mail quand l'espace disque dur est restreint.
Pour le moment j'ai trouvée ceci :
#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 85 ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
mail -s "Alert: Almost out of disk space $usep%" example@example.com
fi
done
Si il fonctionne en .sh esque quelqu'un pourrait me le mettre en .bat ( pour utiliser sur Serveur 2008 )
Merci d'avance
Cordialement
Panwelaa
Partager