- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: need a script
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-04-2008 04:09 AM
06-04-2008 04:09 AM
need a script that reports/informs via email to imv@xyz.org if any of the filesystem is 90%(or more) used
Regards
Maaz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2008 05:32 AM
06-04-2008 05:32 AM
Re: need a script
df -k
or
df - h
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2008 11:25 AM
06-04-2008 11:25 AM
Solution----< script start> -------------------
#!/bin/ksh
disk_ck()
{
echo "\n DISK SYSTEMS"
echo " ------------\n"
echo " Disk Utilization sorted by percent utilization"
echo " - - - - - - - - - - - - - - - - - - - - - - - "
export stat_tmp="/var/tmp/statck.disk.$$"
bdf > $stat_tmp
head -1 $stat_tmp
grep -v ^Filesystem $stat_tmp | sort -k 5
echo "\n Disks Over 90% Full "
echo " - - - - - - - - - - "
integer FULLCT=`grep -v ^Filesystem $stat_tmp | \
grep -e "9.%" -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 filesystems found over 90 percent full"
fi
rm $stat_tmp
}
disk_ck | sendmail imv@xyz.org
--- < script end >----------------------
You could make a few changes to this to send mail only when needed. Send all of the output to a tmp file, and use the last "if else" statement above as a basis of whether or not to use sendmail at that point in the execution to send and email to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2008 11:28 AM
06-04-2008 11:28 AM
Re: need a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2008 12:04 PM
06-04-2008 12:04 PM
Re: need a script
http://forums12.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1212609819425+28353475&threadId=419106
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-04-2008 11:27 PM
06-04-2008 11:27 PM
Re: need a script
Regards