- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: excluding "/" from filesystem check 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
Discussions
Discussions
Forums
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
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
тАО05-16-2008 07:29 AM
тАО05-16-2008 07:29 AM
I'm using a shell script to monitor filesystems and alert via email when they reach a certain capacity. I'm trying to exclude the root filesystem with a 'grep -v', but when I do it's exluding all filesystems and I don't get alerted on anything. I was wondering if someone could check the syntax on this and maybe point me in the right direction. Thanks in advance for your help.
# Main body
#----------
if [[ -n `bdf | grep -v -e / | grep -e "8[5-9]%" -e "9[0-9]%" -e "100%"` ]]
then
bdf | grep -e "8[5-9]%" -e "9[0-9]%" -e "100%" | \
Solved! Go to Solution.
- Tags:
- bdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2008 07:38 AM
тАО05-16-2008 07:38 AM
Solutionif you exclude '/', then you exclude everything under '/' - and ALL is under '/'!
Maybe this works like you want - eclude the logical volume of '/': bdf|grep -v -e lvol3
(lvol3 is in my case the logical volume of '/' - but this is also the standard)
HTH
Volkmar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2008 07:38 AM
тАО05-16-2008 07:38 AM
Re: excluding "/" from filesystem check script
If you want to use 'grep' to exclude the '/' mountpoint, do:
# bdf | grep -v "/$"
...the '$' anchors to the end of the line.
Regards!
...JRF...
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2008 07:49 AM
тАО05-16-2008 07:49 AM
Re: excluding "/" from filesystem check script
bdf|grep -v /dev/vg00/lvol3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2008 07:58 AM
тАО05-16-2008 07:58 AM
Re: excluding "/" from filesystem check script
Thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2008 08:00 AM
тАО05-16-2008 08:00 AM