- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Need system to notify when file system reaches thr...
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
07-30-2002 11:25 PM
07-30-2002 11:25 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2002 11:29 PM
07-30-2002 11:29 PM
Solution#!/usr/bin/sh
# Global settings
#
if [ "$#" -lt "1" ]
then
echo
echo "$0 Usage:"
echo " $0
echo
echo "Example: $0 sysadmin1@mycompany.com,sysadmin3@mycompany.com"
exit 1
fi
if [ "$1" = "debug" ]
then
DEBUG=/usr/bin/true
else
DEBUG=/usr/bin/false
NOTIFY=$1
fi
MYNAME=$(/usr/bin/hostname)
TEMPFILE=/tmp/diskspace.$$
# Get a bdf of the filesystem(s) into a temp file
# If JFS (vxfs) exists, use the example:
# FSTYPES="hfs vxfs"
#
FSTYPES="hfs vxfs"
for FSYS in $(echo $FSTYPES)
do
bdf -i -t $FSYS >> $TEMPFILE
done
trap "rm $TEMPFILE 2> /dev/null " 0
exec 7< $TEMPFILE
#
# Read through the temp file, skipping header line(s)
#
while read -u7 BDFLINE
do
#
# skip the title line(s)
#
echo "$BDFLINE" | grep -qv ^Filesystem
if [ $? -eq 0 ]
then
#
# Check if this is a 2-line bdf (ie, long device filename)
# Concatenate the next line if so
#
LEN=${#BDFLINE}
if [ $LEN -lt 60 ]
then
read -u7 LINE2
BDFLINE=$(echo "$BDFLINE $LINE2")
fi
#
# translate % to a space...large filesystems will run numbers together
# at HP-UX 9.x so we may need spaces to separate params.
#
echo "$BDFLINE" | tr "%" "\ " | read DEVFILE MAXMEGS USEDMEGS FREEMEGS PERCENT IUSED IFREE IPERCENT MNTPNT
# Special cases for some filesystems that need different limits
#
case $MNTPNT in
/LaserROM ) LIMIT=99 ;;
/teno ) LIMIT=100 ;;
/usr ) LIMIT=85 ;;
/home/uas ) LIMIT=90 ;;
* ) LIMIT=91 ;;
esac
if [ $PERCENT -gt $LIMIT ]
then
if $DEBUG
then
echo "$MYNAME: $MNTPNT is ${PERCENT}% full"
else
echo "$MYNAME: $MNTPNT is ${PERCENT}% full" | mailx $NOTIFY
fi
fi
#
# Same test for inode usage M-^V can specify special limits
#
case $MNTPNT in
/home ) ILIMIT=85 ;;
* ) ILIMIT=90 ;;
esac
if [ $IPERCENT -gt $ILIMIT ]
then
if $DEBUG
then
echo "\n\n$MYNAME: $MNTPNT $IFREE inodes left)"
else
echo "$MYNAME: $MNTPNT $IFREE inodes left)" | mailx $NOTIFY
fi
fi
fi
done
rm $TEMPFILE
This works great. It uses email as its notification. You can replace it or add in xdialog if you want a popup to an X display.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2002 11:40 PM
07-30-2002 11:40 PM
Re: Need system to notify when file system reaches threshold
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 12:29 AM
07-31-2002 12:29 AM
Re: Need system to notify when file system reaches threshold
LOW=75
HIGH=90
DATE=$(date)
OUTFILE=/tmp/bdfrep
:>$OUTFILE
(bdf |egrep -v '(cdrom)' |sed -e "1d"|sed -e "/^.*:.*$/d"|sed -e "/^[
] [ ]*.*$/d"|
while read LVOL SIZE USED AVAIL PERCENTAGE MOUNT_PT
do
BREAK=PAUSE
PERCENTAGE=$(echo $PERCENTAGE | sed -e "s/%//")
if [ $PERCENTAGE -ge $HIGH ]; then
echo " $DATE - WARNING - The percentage of used space on filesystem $MOU
NT_PT is greater than $HIGH percent"
/opt/OV/bin/ovevent 171.10.10.15 .1.3.6.1.4.1.4530.1.0.8
elif [ $PERCENTAGE -ge $LOW ]; then
echo " $DATE - WARNING - The percentage of used space on filesystem $MO
UNT_PT is greater than $LOW percent"
fi
done
) >> $OUTFILE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2002 01:43 AM
07-31-2002 01:43 AM
Re: Need system to notify when file system reaches threshold
try this. add this in crontab to execute every day morning to get a mail of file systems more than 90% full
--------
#!/usr/bin/sh
#To find the FS which are filled more than 90% and to get a mail
bdf|awk '{print $5," ",$6}'|sed 's/%/ /g'|awk '$1>89{print $1," ",$2}'|sed '1d'
-------------
crontab entry
55 8 * * * /tc4sys/cord/cron/fscron.sh > (Script path)> /tmp/fssize;elm -s "FS More Than 90 on (machine name)" (mail id)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2002 07:40 AM
08-01-2002 07:40 AM
Re: Need system to notify when file system reaches threshold
If you know Oracle, you know that database stops if the archive directory is full.
My script is pretty simple, it just issue bdf and only look at the ones I care about..
then If it's over threshold value of >90%, then it will email me:
script is attached:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 05:15 AM
08-02-2002 05:15 AM
Re: Need system to notify when file system reaches threshold
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-02-2002 06:30 AM
08-02-2002 06:30 AM
Re: Need system to notify when file system reaches threshold
Here is a simple script .
bdf | awk '{if ($5 > "90") print $NF,$5 }' > /tmp/test
This will create a file test in /tmp with the files sytems and the values of the usage. You can be creative in using this file as a form of mail , message etc . Run this as a part of script
or, look at this link
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x3b8fee3e323bd5118fef0090279cd0f9,00.html
Manoj srivastava