Listing 4: check_filesystem_limit.ksh--Called from by dskmon.ksh
#!/bin/ksh
#===============================================
# "@(#)check_filesystem_limit.ksh"
#
# Usage : check_filesystem_limit.ksh \
# mount_point file1 ...
#
# This script returns the (high or low) limit set for
# that filesystem. Returns nothing if no limit is
# set. The file contains the filesystem name
# followed by the low limit and the high limit.
#
# Author :
# Ravindra Nemlekar
#==============================================
if [ $# -lt 3 ] ; then
echo "Usage: $0 LOW|HIGH mount_point \
file_from_which_to_be_checked"
exit 1
fi
# Check for lower limit else it's the high file limit
if [ "LOW" = "$1" ] ; then
mount_point=$2
shift 2
awk ' $1 == FILE_SYS { value = $2 ; exit 0 }
END { if (value != 0)
print value } ' \
FILE_SYS=$mount_point $*
else
mount_point=$2
shift 2
awk ' $1 == FILE_SYS { value = $3 ; exit 0 }
END { if (value != 0)
print value } ' \
FILE_SYS=$mount_point $*
fi
# End of File
|