Operating System - HP-UX
1834714 Members
2456 Online
110069 Solutions
New Discussion

Re: Announcing bdfmegs 4,8

 
SOLVED
Go to solution
Bill Hassell
Honored Contributor

Announcing bdfmegs 4,8

bdfmegs has been upgraded to 4.8 and has added the following new features:

- overflow with terabyte filesystems and sum totals has been corrected
- select by volume group -V vgname
- sort by column number -c ##

To keep the number fields at a reasonable size, bdfmegs will display numbers more than 9999 with a suffix (g=giga, t=tera, p=peta). For very large filesystems, use -g or link bdfmegs to bdfgigs and bdfgigs will show numbers in gigabytes. Sum totals can now handle terabytes and petabytes.

You can now select one volume group by name as in:

$ bdfmegs -V vg00
File-System Mbytes Used Avail %Used Mounted on
/dev/vg00/lvol3 2504 399 2104 16% /
/dev/vg00/lvol1 291 93 169 36% /stand
/dev/vg00/lvol8 8192 3125 5048 39% /var
/dev/vg00/lvol7 9600 4044 5513 43% /usr
/dev/vg00/lvol4 4096 114 3981 3% /tmp
/dev/vg00/lvol6 8800 6298 2482 72% /opt
/dev/vg00/lvol5 5000 651 4076 14% /Home

and it will show just the mounted vg00 logical volumes.

You can sort by any column. To sort by available space (col 4):

$ bdfmegs -s -c 4 -V vg00
File-System Mbytes Used Avail %Used Mounted on
/dev/vg00/lvol1 291 93 169 36% /stand
/dev/vg00/lvol3 2504 399 2104 16% /
/dev/vg00/lvol6 8800 6298 2482 72% /opt
/dev/vg00/lvol4 4096 114 3981 3% /tmp
/dev/vg00/lvol5 5000 651 4076 14% /Home
/dev/vg00/lvol8 8192 3125 5048 39% /var
/dev/vg00/lvol7 9600 4044 5513 43% /usr
-- sum totals - 37.6g 14.4g 22.8g --- sum totals ---

The above shows a sum total (-s) and sorted by column 4 (Avail).

For very large filesystems, use -g:

$ bdfmegs -s -V vgvlf
File-System Mbytes Used Avail %Used Mounted on
/dev/vgvlf/vlfa 1668.4g 64 1655.3g 1% /nshare1
/dev/vgvlf/vlfb 1668.4g 42.7g 1612.9g 3% /nshare1/proc
-- sum totals - 3336.8g 42.8g 3268.2g --- sum totals ---

$ bdfmegs -gs -V vgvlf
File-System Gbytes Used Avail %Used Mounted on
/dev/vgvlf/vlfa 1668 0 1655 1% /nshare1
/dev/vgvlf/vlfb 1668 42 1612 3% /nshare1/proc
-- sum totals - 3336 43 3268 --- sum totals ---

To see the usage summary, use -? as an option:

Usage: bdfmegs [ -clgPpqstuVv ] file(s) or dir(s) ]
where:
-c # = Sort on column #
-g = show gigabytes, otherwise megabytes
-l = local (no NFS)
-p ## = highlight % -ge ##
-P ## = show only % -ge ##
-q = suppress header line and no char enhancements
-s = summarize total, used and available
-t = specifc filesystem: (hfs vxfs nfs cdfs cifs autofs DevFS)
-u = usage (return code=0, Usage to stdout)
-v = verbose (type, version, largefiles)
(version info read permission for mountpoint)
-V = select a volume group

File(s) or dirpath(s) may be specified to limit
the output of bdfmegs as in:

bdfmegs -vlg /usr/contrib/bin /var/tmp

If bdfmegs is run as bdfgigs (ie, a link), then -g is default.
(bdfmegs ver 4.8_Nov2008)


Bill Hassell, sysadmin
22 REPLIES 22
Patrick Wallek
Honored Contributor
Solution

Re: Announcing bdfmegs 4,8

Impressive, as alway, Bill!!!!

Thanks for such a great utility!
Patrick Wallek
Honored Contributor

Re: Announcing bdfmegs 4,8

I just thought of something......

Not that I want to look a gift horse in the mouth, but is there a way with the '-V' to do something like:

# bdfmegs ! -V vg00 -s

so I can all VG's EXCEPT VG00?
Olivier Masse
Honored Contributor

Re: Announcing bdfmegs 4,8

Thanks Bill, we're a regular user of your tool here.
Bill Hassell
Honored Contributor

Re: Announcing bdfmegs 4,8

> something like:
> # bdfmegs ! -V vg00 -s

Interesting. I'll put the request into my creeping elegance folder... ;-)


Bill Hassell, sysadmin
David G. Douthitt
Regular Advisor

Re: Announcing bdfmegs 4,8

Are you aware that df -g does not work under HP-UX 11i v2? This means that bdfmegs -v gives errors for NFS mounts on v2.

Also, in the usage, I think you meant specific and not specifc.

Excellent tool - spreading through the enterprise as we speak....
Dennis Handly
Acclaimed Contributor

Re: Announcing bdfmegs 4,8

>David: spreading through the Enterprise as we speak

Oh boy, what will Spock say? :-)
Bill Hassell
Honored Contributor

Re: Announcing bdfmegs 4,8

> df -g at 11.23

I knew that the loss of the testdrive.hp.com machines would be a problem. I'm stuck with 11.11 for now. I'll look at a coding alternative.

> Oh boy, what will Spock say? :-)

Live long and prosper.


Bill Hassell, sysadmin
Bill Hassell
Honored Contributor

Re: Announcing bdfmegs 4,8

> I think you meant specific and not specifc.

Yes, I see the problem. It is caused by defective keyboards. I have never found one that will do what I want it to do. ;-)


Bill Hassell, sysadmin
Patrick Wallek
Honored Contributor

Re: Announcing bdfmegs 4,8

>>> Oh boy, what will Spock say? :-)

>>Live long and prosper.

Peace and long life.
VK2COT
Honored Contributor

Re: Announcing bdfmegs 4,8

Hello,

In spite of accidental mistake,
the efforts by people like Bill Hassell
must be acknowledged.

Bill, your script is very useful.

Yes, it is pity that we lost
testdrive.hp.com. I am employed by HP but I
have to say that the customers appreciated
this free access and miss it a lot.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Suraj K Sankari
Honored Contributor

Re: Announcing bdfmegs 4,8

Hi,

Thanks Bill, really bdfmesg is such a nice tool I have implement all my hp server I have moved bdf to bdf.old and bdfmesg into bdf.

Again lots of thanks to you.

Suraj
ARCHITECT_1
Advisor

Re: Announcing bdfmegs 4,8

hi

such a great and useful tool bill.

Thanks
Steven E. Protter
Exalted Contributor

Re: Announcing bdfmegs 4,8

Shalom,

Great tool Bill.

Free tool, whats the first thing Patrick does, ask for an enhancement! Chutzpah.

Linux df tool provides much of the same functionality.

It might make some sense to format GB display the way df does on Linux. Eee! Another enhancement request! Chutzpah!

Hope you are well Bill.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Bill Hassell
Honored Contributor

Re: Announcing bdfmegs 4,8

> It might make some sense to format GB display the way df does on Linux.

That was considered several months ago but since many people were asking for scriptable output (the -q option), I tried to stay away from suffixes like g, t and p. This last enhancement was to handle 32bit overflow, especially with sums. The other problem with suffixes is that it makes the data harder to compare (a large value like 11.6g looks smaller than 9452 in megabytes). What I may add is adjustable number columns such that the full number (like 123456789) is shown even though it is really 123 terabytes. Those terminal windows with 150-175 columns are looking more atractive every day...


Bill Hassell, sysadmin
Jaime Bolanos Rojas.
Honored Contributor

Re: Announcing bdfmegs 4,8

Good job Bill, this is just a small prove of what you are are highly recognized in the HP-UX industry.

Hope someday to be half of a good tech as you are.

Regards,

Jaime.
Work hard when the need comes out.
James R. Ferguson
Acclaimed Contributor

Re: Announcing bdfmegs 4,8

Hi Bill:

Very nice indeed!

> since many people were asking for scriptable output (the -q option), I tried to stay away from suffixes like g, t and p.

I applaude that for the reasons you stated. As you noted, this makes the use of the output easier for then next (piped) input. Perhaps a separate column to indicate the magnitude, separated from the numeric value, would be a nice compromise.

> What I may add is adjustable number columns such that the full number (like 123456789) is shown even though it is really 123 terabytes.

I would like to see you round to the nearest integer rather than truncate in this case. In keeping with easily filterable output, I guess we would want to avoid real numbers and remain with integers for shell arithmetic. I wholly agree that more than an 80-colunm output is a value option to have.

Whatever you do, this is a very nice script with a good number of options that greatly enhance the classic 'bdf'. Thanks!

Regards!

...JRF...
Dennis Handly
Acclaimed Contributor

Re: Announcing bdfmegs 4,8

>Dusan: it is pity that we lost testdrive.hp.com.

Have you tried the replacement: http://www.hp.com/go/pvp
Bill Hassell
Honored Contributor

Re: Announcing bdfmegs 4,8

> Have you tried the replacement: http://www.hp.com/go/pvp

Tried several times to locate a the systems. I have a DSPP login but PVP never shows any hardware or login capability. I'm stuck at the PVP page trying to locate:

"To enter the HP Partner Virtualization Program, please log in to DSPP and click the HP Partner Virtualization Program (HP PVP) Log In link on the right."

(thyere's no login link on the right) Any ideas?


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: Announcing bdfmegs 4,8

>Bill: I have a DSPP login but PVP never shows any hardware or login capability. I'm stuck at the PVP page trying to locate: (there's no login link on the right)

Hmm, I don't see it either. The page says "for DSPP company members":
http://h21007.www2.hp.com/portal/site/dspp/menuitem.b808367c27274c47e06ff7104894e601

I'll have to try that next week.
Dennis Handly
Acclaimed Contributor

Re: Announcing bdfmegs 4,8

Bill: ... (there's no login link on the right)

This link (the first) only shows up if you are signed in and you ARE a DSPP company member.
VK2COT
Honored Contributor

Re: Announcing bdfmegs 4,8

Hello,

Ahh, I am not a DSPP company member. I am
an HP staff member and need to have access to
HP-UX servers for various tests at all times :)

That is why I miss testdrive site.

Personally (forget that I work for HP),
I think testdrive was a good and
worthy initiative.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Dennis Handly
Acclaimed Contributor

Re: Announcing bdfmegs 4,8

>Dusan: I am not a DSPP company member. I am
an HP staff member

I have a special logon so I can make sure what we put there is valid.