Operating System - HP-UX
1847084 Members
5026 Online
110262 Solutions
New Discussion

Re: Filesystem alert script file

 
SOLVED
Go to solution
Donald C Nelson
Frequent Advisor

Filesystem alert script file

Does anyone have a script file that can email Admins if a filesystem is over a certain percentage used. We used to have a Patrol Agent monitor this but the new version of Patrol will not support HP-UX 10.20.
6 REPLIES 6
Pete Randall
Outstanding Contributor
Solution

Re: Filesystem alert script file

Donald,

I think I remember one in one of Bill's "favorite sysadmin scripts" threads. Here's a link to the latest, which contains links to the previous two:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51050


Pete

Pete
Robert-Jan Goossens_1
Honored Contributor

Re: Filesystem alert script file

Donald,

There are a few old threads with a lot of sysadmin scripts.

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=123030

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=178514

Search inside the link for filesystem

Regards,
Robert-Jan
TwoProc
Honored Contributor

Re: Filesystem alert script file

Donald, in all truth, there's better than this one... but, it's one that was written long ago, and still works... so it's still used.

This one checks out just one system that we worry about often. Youll have to chage it to cover more disk systems, different disk systems, etc.
This is run via cron and the output is piped out via mail command to a list of users.

#
# disk check
#
export stat_tmp="/tmp/statck.a4"
echo "\n /a4 DISK SYSTEM"
echo " ------------\n"
echo " /a4 Disk Utilization "
echo " - - - - - - - - - - - - - - - - - - - - - - - "
bdf /a4 > $stat_tmp
head -1 $stat_tmp
grep -v ^Filesystem $stat_tmp | sort -k 5

echo "\n Is /a4 Over 80% Full? "
echo " - - - - - - - - - - "
integer FULLCT=`grep -v ^Filesystem $stat_tmp | \
grep -e "8.%" -e "1..%" | sort -k 5 | wc -l `
if [ $FULLCT -gt 0 ]
then
head -1 $stat_tmp
grep -v ^Filesystem $stat_tmp | grep -e "9.%" -e "1..%" | sort -k 5
else
echo " ... No it is not, no need to panic "
fi
We are the people our parents warned us about --Jimmy Buffett
Thierry Poels_1
Honored Contributor

Re: Filesystem alert script file

hmmm, sorry I don't like percentages on its own: 20% of a 10MB filesystem is nothing, 5% of a 1TB filesystem is a damn lot of space.

regards,
Thierry.
All unix flavours are exactly the same . . . . . . . . . . for end users anyway.
David DeWitt_2
Frequent Advisor

Re: Filesystem alert script file

--------------------
checkit=$(bdf | grep -E "9.%|10.%" | wc -l)
if (($checkit > 0))
then
mailx -s "$(hostname) filesystem warning $(date)" root
fi
--------------------
Donald C Nelson
Frequent Advisor

Re: Filesystem alert script file

Pete Randall steered me toward the web site that helped me the most.