- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Auto email when mountpoint exceeds 90%
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
Forums
Discussions
Discussions
Discussions
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
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
06-25-2003 07:36 AM
06-25-2003 07:36 AM
Any help/utilities/suggestions would be awesome. Thanks. :)
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 07:38 AM
06-25-2003 07:38 AM
SolutionThis question was asked just this morning. There are various scripts in this thread:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x026250011d20d6118ff40090279cd0f9,00.html
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 07:42 AM
06-25-2003 07:42 AM
Re: Auto email when mountpoint exceeds 90%
#!/bin/sh
THRESHHOLD="9[0-9]%"
THRESHHOLD1="100%"
NOTIFY="sysadmins"
HOSTNAME=`hostname`
for FILESYSTEM in `bdf -l | grep -e $THRESHHOLD -e $THRESHHOLD1| awk -v HOSTNAME =\`hostname\` '{print $6":"HOSTNAME":"$5}'`
do
MESSAGE=`echo $FILESYSTEM | awk -F: '{print "The " $1 " file system on "
$2 " is at " $3 " utilization"}'`
mailx -s "$MESSAGE" my_mail_address.com < /dev/null
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 07:45 AM
06-25-2003 07:45 AM
Re: Auto email when mountpoint exceeds 90%
Put this simple script in cron. Man "cron" for more details. Depending on how often you want to check the usage, you will need to decide the interval. Run it manually and see if it works as it is supposed to.
#!/usr/bin/ksh
#Add the mount points below
MOUNTS="/db001 /db002 /home /perf"
#Replace this with your id
MYMAIL=your_id@yourmail.com
THRESHOLD=90
STAMP=0
for MOUNT in $MOUNTS
do
USED=$(df -k $MOUNT |awk '/% allocation used/ {print $1}')
if [ $USED -ge $THRESHOLD ]
then
echo $MOUNT: $USED >> /tmp/mount$$
STAMP=1
fi
done
if [ $STAMP = 1 ]
then
mail /tmp/mount$$
fi
mailx -s "Filesystem Usage Report" $MYMAIL < /tmp/mount$$
rm -f /tmp/mount$$
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 07:45 AM
06-25-2003 07:45 AM
Re: Auto email when mountpoint exceeds 90%
Various ways,
1. Glance / Measureware - Very good monitoring and trending product, that can be used to set alarms for Disk Space used and to alert based on these.
2. Scripting - As in the above posting, you can write a script to monitor space and report. However, you need to judge how quickly you need to know about the lvol reaching the limit. You also need to cater for exceptions (database filesystems can be exempted, as can other static filesystems like copies of CDs, etc).
Bdf can be used to good effect for scripting, but you have to watch the double-line effect
eg. /dev/vgXXX/lvol22 # End line 1
222222 3333333 444444 59% /mntpt1 # End Line 2
Share and Enjoy! Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 07:49 AM
06-25-2003 07:49 AM
Re: Auto email when mountpoint exceeds 90%
NF == 6 { print $1" "$2" "$3" "$4" "$5" "$6 }' |awk '$1 !~ /:/ { print $0 }'
Sorry, here's the code to bring bdf back to single lines for each entry (excluding NFS Mounts).
Share and Enjoy! Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-25-2003 12:57 PM
06-25-2003 12:57 PM