Friday 10 August 2012

Script which will send you email alert when swapIO us more than 100 MB:

Script which will send you email alert when swapIO us more than 100 MB:
==========

The Script which will send you email alert when swapIO us more than 100 MB:

#!/bin/bash
io=`free -m | awk '{print $3}' | sed '1,3 d'`
info1="SwapIO is : $io MB"
str="============================="

if [ $io -ge 100 ]; then
info="SwapIO is more than 100 MB"
echo -e "$str\n$info\n$info1\n$str" | mail -s "Alert: SwapIO for `hostname` on
`date`" abc@yourdom.com
else
# echo -e "$str\n$info1\n$str" | mail -s "Alert: SwapIO for `hostname` on
`date`" abc@yourdom.com
fi

No comments:

Post a Comment

Note: only a member of this blog may post a comment.