- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script for summation
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-10-2009 07:41 AM
тАО05-10-2009 07:41 AM
Solved! Go to Solution.
- Tags:
- bdf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2009 08:09 AM
тАО05-10-2009 08:09 AM
Re: script for summation
I recieved this updated bdf version from here some of formus.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2009 08:17 AM
тАО05-10-2009 08:17 AM
Re: script for summation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2009 10:43 AM
тАО05-10-2009 10:43 AM
Re: script for summation
Did you see the -s option to bdfmegs?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2009 11:45 AM
тАО05-10-2009 11:45 AM
SolutionAs noted, Bill has done this and much, much more in his script provided to you.
However, as a general example, here is one way to perform summation of fields in input data. Using 'bdf' output:
# bdf|awk '/^\/dev/ {KB+=$2;U+=$3;A+=$4};END{printf "%7.0f %7.0f %7.0f\n",KB/1024,U/1024,A/1024}'
The /^\/dev/ says when matched, perform what exists in the {...} statement. In this case, this skips the 'bdf' header from consideration.
The summation is done into our own variables 'KB', 'U' and 'A' for the appropriate fields of each line read by 'awk'. Fields are labeled '$1...$199' and a whole line is denoted by $0.
The 'END{...}' block is executed once when all input has been exhausted. Here, we simply print what we have summed, converting from values in KB to values in MB by dividing the sums by 1024.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2009 10:48 PM
тАО05-10-2009 10:48 PM
Re: script for summation
just one on the top. bdf has a little problem with long devicenames. This could be a point, if you are using VXVM. So I would use awk the other way round:
bdf | awk '/% \// {KB+=$(NF-4);U+=$(NF-3);A+=$(NF-2)};END{printf "%7.0f %7.0f %7.0f\n",KB/1024,U/1024,A/1024}'
$(NF-4) is the fifth field from the end of line and so on. If you don't want to see NFS mounts in your output use "bdf -l".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-10-2009 10:59 PM
тАО05-10-2009 10:59 PM
Re: script for summation
Please download this file (bdfmesg) from below link you will find this is a great tool written by Mr.Bill Hassell.
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1326767
For you to query you have to use
#bdfmesg -s
-s = summarize total, used and available
Many Thanks to Mr.Bill Hassell to create a nice and useful tool.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2009 01:46 AM
тАО05-11-2009 01:46 AM
Re: script for summation
You will find in attachment a self made script to prepare a semicolumn separated field to import in Excel. This summarizes per vg all lv's and make an global total fron a server. This script can be running in cron ans send the result in a mail.
I hope it will help
Roland
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2009 03:34 AM
тАО05-11-2009 03:34 AM
Re: script for summation
Be advised that the copy (version 5.0) of Bill's script attached by the poster named "avizen9" (above) has a small bug. Bill corrected this the following month.
You should fetch and use his 5.1 version posted by Bill at the bottom of this link:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1326767
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-11-2009 03:46 AM
тАО05-11-2009 03:46 AM