Var Check Script (Help improve if possible)

I am working on a script to check the var on all of my systems. Can someone help me fix it to work better or give me suggestions.

#!/bin/ksh

IN=/path/to/list_of_workstations.txt

while read hostnames
  do

if ping $hostnames 1 | grep alive > /dev/null  
  then
        percent=`ssh -q -n $hostnames df -hk | grep "/var$/ | awk '{print $5}'`
        echo $hostnames $percent
fi

done <$IN
tail -f /dev/null    # This is so the window doesnt close


Thanks for looking and for any help!

The df command can take the filesystem as a parameter. You'll probably want to get rid of the heading line. I don't have the same version of "df" as you (many don't have "-h") so it's a guess that the heading contains the string "avail".

percent=`ssh -q -n $hostnames df -hk /var | grep -iv "avail" |awk '{print $5}'`

The output from "df -P" is more consistent for mixed platforms.

the h puts it in human readable format.
my output of my script is

workstation1 25%
workstation2 35%
workstation3 76%

I just want to make it faster or improve it.

The big efficiency improvement is to only execute "df" on the "/var" partition.