shell script for file system alert
shell script for file system alert
==================================
Below is script for sending notification ,when a mount point or filesystem crosses a threshold value. For solaris
#!/bin/sh
df -h | egrep -v '/system|/platform|/dev|/etc|lib' | awk '{print $6 " " $5}'|cut -d% -f1|while read fs val
do
if [ $val -ge 90 ]
then
echo "The $fs usage high $val% \n \n \n `df -h $fs`" | mailx -s "Filesystem $fs Usage high on Server `hostname`" support@dbaclass.com
fi
done
Put in crontab:
00 * * * * /usr/local/scripts/diskalert.sh
Comments
Post a Comment