August 4, 2010

email from sar and parsar out put



I am using a script to send email from parsar / sar command if there is a specific value for CPU usage, If condition is not working but I can see the variable declared in echo command

I am using following script for send email from parsar command, If I comment if and then line then echo is working but script is not working with if condition

parsar --peakonly --daily > peakonly_daily
result1=$(grep "6.9" peakonly_daily)
if [ "$result1" = "6.9" ];
echo $result1
#mail -s "Web-03: Daily and Peakonly Utilization of Memory and CPU" < peakonly_daily


can any one help me to resolve this issue

Asif Shams

Click Here!