Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

df ksh and exclude a filesystem 1

Status
Not open for further replies.

AIXFinder

IS-IT--Management
Jan 4, 2007
97
US
I have df -k file system monitor script below. What I need is to exclude /backup filesystem because it is always around 98 or 99%. How do you put the line for excluding the /backup?

bla...

ALERT_ADMIN () { mail -s "${MAIL_SUBJ}" $DIST_LIST << EOF
Filesystem $fsname has reached $sz% of its capacity.
EOF
return
}

cd . > $WORKDIR/freespace.lst
exec 8< $WORKDIR/freespace.lst

df -k | grep -v -i filesystem | grep -v ":" | awk '{print $7,substr($4,1,2)}' |
grep -v "%" | grep -v proc > $WORKDIR/freespace.lst

if [ -f $WORKDIR/freespace.lst ]
then
while read -u8 fsname sz ;
do
if [[ $sz -gt $WARNLEVEL ]]
then
ALERT_ADMIN
fi
done
fi


thx much
 
df -m | grep -v /backup

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
where do I need to plug the line in?

thx much
 
I think you mean this?

df -k | grep -v /backup | grep -v -i filesystem | grep -v ":" | awk '{print
$7,substr($4,1,2)}' |
grep -v "%" | grep -v proc > $WORKDIR/freespace.lst
 
Yep

Mike

"Whenever I dwell for any length of time on my own shortcomings, they gradually begin to seem mild, harmless, rather engaging little things, not at all like the staring defects in other people's characters."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top