- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: monitoring filesystem growth
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2007 09:31 PM
тАО05-24-2007 09:31 PM
Being a new HP-UX sysadmin, I wonder if anyone has a script to monitor filesystem growth on daily basis.
I have experienced an unfortunate incident whereby one of our critical filesytem grow so rapidly, causing application failure.
I've created a small script to capture the filesystem utilization. But at this moment the comparison is done manually.
Appreciate all your input. Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2007 09:36 PM
тАО05-24-2007 09:36 PM
SolutionSeveral ways to do it in this thread.
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=51050
Scripts with email alarms, all kinds of good stuff.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-24-2007 11:59 PM
тАО05-24-2007 11:59 PM
Re: monitoring filesystem growth
Here's one I use:
#!/usr/bin/sh
typeset -i MAXPCT=90
BDFMEGS=/path/to/bdfmegs.sh
if [ $(${BDFMEGS} -qlP ${MAXPCT} | wc -l) -gt 1 ]
then
mailx -m -s "WARNING! FILESYSTEM(S) OVER ${MAXPCT}% FULL!" your@email.addr << EOF
File-System Gbytes Used Avail %Used Mounted on
$(${BDFMEGS} -qglP ${MAXPCT})
EOF
fi
exit 0
It relies on Bill Hassell's bdfmegs.sh shell script (attached). Schedule it to run every 10 minutes or so via cron.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-25-2007 12:16 AM
тАО05-25-2007 12:16 AM
Re: monitoring filesystem growth
For execution every 10 minutes, your crontab entry should be similar to the following:
5,15,25,35,45,55 * * * * /path/to/check_fs_usage.sh
Note that a potential problem ("feature"?) with the script I supplied is there is no mechanism to stop emails from being sent after the initial one. This could be resolved quite easily by modifying the script to make use of a lockfile.
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2007 05:13 PM
тАО05-27-2007 05:13 PM
Re: monitoring filesystem growth
We use the following script for filesystem monitoring...it sends 3 alrm beeps to all logged in guys and a message too..
# cat /tmp/check_bdf.sh
count=0
function check_bdf
{
> /tmp/bdflog.txt
bdf -l | awk '$0 !~ /^F/' |awk '{if (NF!=1){
if (NF==5){
print $4"\t" $5"\t"
}
else{
print $5"\t\t" $6"\t"
}
}}' | sed 's/'%'/''/' >> /tmp/bdflog.txt
}
function alert
{
while read percent dir
do
if [ $percent -ge 95 ]
then
for i in `who|awk '{printf ("/dev/"$2"\n")}'`
do
echo "----------------------------------------------------------" > $i
echo "WARNING :" $dir "-----------> " $percent"% full " > $i
echo " PLZ CONTACT SYSTEM ADMINISTRATOR AT 4238xxxx/4240xxxx (CDC TEAM)" > $i
echo "----------------------------------------------------------" > $i
echo "\a" > $i
sleep 1
done
fi
done
} < /tmp/bdflog.txt
alert
#check_bdf # create a bdf log file
while [ $count -lt 2 ]
do
check_bdf
alert
count=$(($count + 1))
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2007 03:11 PM
тАО05-28-2007 03:11 PM
Re: monitoring filesystem growth
Bill Hassell, sysadmin