#!/BIN/BASH
# To alert whenever lsof crosses 80%
maxlimit=32000
echo 'Max limit is ' $maxlimit
tlimit=$(bc <<< $maxlimit*0.8)
echo 'Treshold limit at 80% ' $tlimit
a=$(lsof | wc -l)
echo 'Current usage ' $a
if [ $(bc <<< "$a > $tlimit") -eq 1 ]
then
echo 'lsof =' $a 'has exceeded 80% of maximum limit' | /usr/bin/Mail -s "ALERT!!!" "*****@cisco.com"
fi
* * * * * bash /root/vasanth/lsef/script.sh
In the above script The, the output is to send a mail to the corresponding Mail ID . When
When I run it manually it sends the mail When.
But, when it is scheduled in CRONTAB Mail isntcron, the mail is not being sent.
I cant understand what the problem is........ How could I debug it?