- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: 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
тАО09-29-2002 07:21 PM
тАО09-29-2002 07:21 PM
If it is more than 85% an email will be send.
[root@myserver]/root/home/root $bdf | grep var
/dev/vg00/lvol8 5572685 4429938 585478 88% /var
[root@myreserver]/root/home/root $bdf | grep var | awk '{print $5}'
88%
Once I get the value of 88% from the awk. How could I do a numeric comparision. Should I take out the "%" symbol.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2002 07:29 PM
тАО09-29-2002 07:29 PM
Solutiontake out the % symbol.
sed 's/%//g' will do this for you.
That's a single quote pointing -> (that way).
you can probably do the entire thing in sed (or awk).
my solution would spawn a lot of shells, because you're using grep, awk and sed. So it's probably not ideal.
Scott.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2002 09:10 PM
тАО09-29-2002 09:10 PM
Re: script
for i in `bdf | grep arch | awk '{print $4}' | sed 's/%//g'`
do
echo $i
if [ $i -gt 90 ]
then
echo "more than 20%"
fi
done
Hi This is what my script will do check some filesystem that is more than 90%.
I used the output of bdf 4096000 884400 3186560 22% /oracle/TRD/saparch
4096000 306480 3759976 8% /oracle/TRA/saparch
4096000 53104 4011376 1% /oracle/TBD/saparch
4096000 270583 3586394 7% /oracle/SBD/saparch
For the for loop how could I also print out the filesystem name that is more than 90%
The current script can only find out filesystem that is more than 90% but it won't give the filesystem name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-29-2002 09:33 PM
тАО09-29-2002 09:33 PM
Re: script
bdf |
awk '/arch/ {
percent=$4;
filesystem=$5;
percentage=$4;
sub(%,"",percentage);
if (percentage > "90") printf("%5s%s\n",percent,filesystem);
}'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2002 12:23 AM
тАО09-30-2002 12:23 AM
Re: script
syntax error The source line is 5.
The error context is
>>> sub(% <<< ,"",percentage);
awk: The statement cannot be correctly parsed.
The source line is 5.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-30-2002 12:26 AM
тАО09-30-2002 12:26 AM
Re: script
the % must be quoted,
replace
sub(%,"",percentage);
with
sub("%","",percentage);
Regards