- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script having problem for file system monitoring.
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-05-2009 11:25 PM
07-05-2009 11:25 PM
I am using this filesystem monitoring script, But the problem with this script is that it is not sending a mail when the mount point "/oracle/JKD/saparch" and "/oracle/JKD/102_64" exceeds the threshold it is working fine for all other mount points which are in the check.conf file.
Please find the diskspace.sh script as below,
#!/usr/bin/ksh
# This script may be used to check for available disk space on any local server
# To change the configuration use /home/check.conf
# Debugging purposes
#set -x
PATH=/usr/bin:/usr/sbin
CONF_FILE=/home/check.conf
# Source default env vars
. ${CONF_FILE}
# Count number of FS to check
i=${#FS[*]}
# echo max - $MAX_THRESH
# Check each Filesystem
while [ ${i} -gt 0 ]
do
PCT=`bdf ${FS[$i]} | grep -v Filesystem | cut -c 45-47`
if ((PCT>THRESH[$i]))
then
echo " ${THRESH[$i]} "
if (("${PCT}>${MAX_THRESH}"))
then
echo "Out of disk space for `bdf ${FS[$i]}` on `hostname`" |sendmail name@xxxxx.com
else
echo "Threshold exceeded for `bdf ${FS[$i]}` on `hostname`" |sendmail name@xxxxx.com
fi
fi
let i=i-1
done
exit 0
And also check.conf script as below,
# MAX_THRESH is the max thresh before sending out a critical message
MAX_THRESH=91
# THRESH for each FS is the THRESH before sending a message
FS[1]=/ ;THRESH[1]=80
FS[2]=/stand ;THRESH[2]=70
FS[3]=/var ;THRESH[3]=80
FS[4]=/usr ;THRESH[4]=80
FS[5]=/tmp ;THRESH[5]=90
FS[6]=/opt ;THRESH[6]=97
FS[7]=/oracle/JKD/saparch ;THRESH[7]=50
FS[8]=/usr/sap/JKD ;THRESH[8]=70
FS[9]=/sapmnt/JKD ;THRESH[9]=85
FS[10]=/oracle ;THRESH[10]=50
FS[11]=/oracle/JKD ;THRESH[11]=90
FS[12]=/home ;THRESH[12]=50
FS[13]=/oracle/JKD/102_64 ;THRESH[13]=35
FS[14]=/opt/sapbc47 ;THRESH[14]=85
FS[15]=/tmp/sapwork ;THRESH[15]=97
FS[16]=/share ;THRESH[16]=80
Thanks,
Narendra
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2009 11:39 PM
07-05-2009 11:39 PM
Re: Script having problem for file system monitoring.
What does bdf show for each?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2009 11:40 PM
07-05-2009 11:40 PM
SolutionI don't see anything wrong with the script. If it works for other file systems it should work for those. It could be Oracle isn't cutting an extent at a convenient time and when it does, it jumps the file system from 89% to 101% capacity.
You might want to have the dba change the size of oracle extents to a smaller number. Its not possible for me to test your script in a realistic condition here.
There are other scripts for this purpose that might work, but that won't help if what I suspect is happening is true.
If I am right about oracle trying to cut a large extent, then perhaps simply setting the threshold lower will do the job.
Also oracle database has a built in limit, maybe 100 extents after which it won't cut new extents. It gives an out of space message after that, when in fact it is not out of space, and a dba needs to modify the maximum number of extents permitted on the tablespace.
For your convenience:
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=5827
My answer in this thread links to hundreds of syadmin scripts you might find helpful.
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1336882
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
07-06-2009 05:46 AM
07-06-2009 05:46 AM
Re: Script having problem for file system monitoring.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2009 07:51 AM
07-06-2009 07:51 AM
Re: Script having problem for file system monitoring.
The big red flag that I see in scanning your script is this:
# PCT=`bdf ${FS[$i]} | grep -v Filesystem | cut -c 45-47`
Do you believe that the percent used for every filesystem is always going to be in columns 45-47? I don't. You should use a shell 'read' or something like 'awk' to pluck the fields in the line as seperated by whitespace. What you get with your 'cut' isn't probably what you think.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2009 08:24 AM
07-06-2009 08:24 AM
Re: Script having problem for file system monitoring.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-06-2009 06:22 PM
07-06-2009 06:22 PM
Re: Script having problem for file system monitoring.
https://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1048509&admit=109447626+1246933165093+28353475
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-18-2009 10:54 PM
08-18-2009 10:54 PM