help with case statement

I am writing a script to pull diskspace information from our servers. Here is the script that I wrote:

#!/bin/ksh

for host in `cat /oper/hosts/esc.misc`
do
ssh -q -o ConnectTimeout=10 operator@$host df -h|grep "/dev/" |egrep '8[
0-9]%|9[0-9]%|100%' | awk '{print H " " "at " $5 " with " $4 " free " " on mount
" $6}' H=$host
case $? in
0)
echo "=========== $host worked ==============="
;;
* )
echo "=========== $host failed ==============="
;;
esac
done

The problem is that I know one of the servers in my list is down yet it still shows up in the case statement as working. I'm not sure why this is happening? Do any of you scripting gods see something that I am missing?

Thanks
Robert

The problem you have is your piping your output to multiple commands. Since the last command was awk which ran okay with no errors you get a 0 for $?. Another words you will get output from the awk command even though the input didn't contain anything. Therefore the status would be zero.