- Community Home
- >
- Servers and Operating Systems
- >
- Operating System - Linux
- >
- System Administration
- >
- need a script
-
- Forums
-
Blogs
- Alliances
- Around the Storage Block
- Behind the scenes @ Labs
- HPE Careers
- HPE Storage Tech Insiders
- Infrastructure Insights
- Inspiring Progress
- Internet of Things (IoT)
- My Learning Certification
- OEM Solutions
- Servers: The Right Compute
- Shifting to Software-Defined
- Telecom IQ
- Transforming IT
- Infrastructure Solutions German
- L’Avenir de l’IT
- IT e Trasformazione Digitale
- Enterprise Topics
- ИТ для нового стиля бизнеса
- Blogs
-
Quick Links
- Community
- Getting Started
- FAQ
- Ranking Overview
- Rules of Participation
- Contact
- Email us
- Tell us what you think
- Information Libraries
- Integrated Systems
- Networking
- Servers
- Storage
- Other HPE Sites
- Support Center
- Enterprise.nxt
- Marketplace
- Aruba Airheads Community
-
Forums
-
Blogs
-
InformationEnglish
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-04-2008 11:28 AM
06-04-2008 11:28 AM
Re: need a script
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
06-04-2008 11:27 PM
06-04-2008 11:27 PM
Re: need a script
Regards
Hewlett Packard Enterprise International
- Communities
- HPE Blogs and Forum
© Copyright 2019 Hewlett Packard Enterprise Development LP