cancel
Showing results for 
Search instead for 
Did you mean: 

bdfmegs ver 5.0

 
SOLVED
Go to solution
Bill Hassell
Honored Contributor

bdfmegs ver 5.0

The latest version of bdfmegs is attached. The major changes are multiple -V vgnames and -N to exclude one or more vgnames.

The -V option can now be repeated many times, like this:

bdfmegs -V vg00 -Vvgextra,vg01,vg12

The new -N option is the opposite of -V. It can be used to not show selected vgnames, like this:

bdfmegs -N vg01,vg02

For those that have not used bdfmegs before, here are the help details:

Usage: bdfmegs [ -cghlNPpqstuVv ] [ ]
where:
-c # = Sort on column #
-g = show gigabytes, otherwise megabytes
-h = Usage (return code=0, Usage to stdout)
-l = local (no NFS)
-N = skip one or more volume groups
Repeat -N or use commas: -N vg10,vg24
-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 one or more volume groups
Repeat -V or use commas: -V vg00,vg01

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 5.0_Mar2009)


Bill Hassell, sysadmin
19 REPLIES
Uday_S_Ankolekar
Honored Contributor

Re: bdfmegs ver 5.0

Great! Thanks Bill.
Good Luck..
Patrick Wallek
Honored Contributor

Re: bdfmegs ver 5.0

Bill,

Most excellent!!!! And thank you very much for the '-N' option. I **WILL DEFINITELY** use that.

See you in Las Vegas!
(I have signed up for your Monday class!!!)

avizen9
Esteemed Contributor

Re: bdfmegs ver 5.0

Hello Bill,

good to know its having some more additional options,

shall i use this with 10.10 version,
i had downloded this file, can i just copy this to any server/station and run it? is this executable? or i need to follow any step to make it work, let me know, thanks again.:)
avizen9
Esteemed Contributor

Re: bdfmegs ver 5.0

okey,
just i had tried its executable, its good can get more info with it,


thanks bill :)
Suraj K Sankari
Honored Contributor

Re: bdfmegs ver 5.0

Hi Bill,

Congratulation for your new version...
and many thanks to you for making such an nice tool.

Suraj
PatRoy
Regular Advisor

Re: bdfmegs ver 5.0

Hey there. If you don't mind me reporting a "bug", it can't read volume larger than 1 terabyte... see below :

[root@hostname]:/$ /usr/bin/bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 1048576 195304 846624 19% /
/dev/vg00/lvol1 1835008 462664 1361704 25% /stand
/dev/vg00/lvol8 34963456 17521896 17328328 50% /var
/dev/vg00/lvol7 6291456 3004608 3261248 48% /usr
/dev/vg00/lvol6 1048576 26992 1013728 3% /tmp
/dev/disk/disk80 20971520 4395700 15539850 22% /sybase
/dev/vg00/lvol5 10485760 5773400 4675576 55% /opt
/dev/vg01/ignite 23068672 7928017 14194430 36% /ignite
/dev/vg00/lvol4 4194304 1521824 2652072 36% /home
DevFS 13 13 0 100% /dev/deviceFileSystem
/dev/dumps/fsdump 5341052928 184704 5299142704 0% /dumps

[root@hostname]:/$ bdf
File-System Mbytes Used Avail %Used Mounted on
/dev/vg00/lvol3 1024 190 826 19% /
/dev/vg00/lvol1 1792 451 1329 25% /stand
/dev/vg00/lvol8 33.3g 16.7g 16.5g 50% /var
/dev/vg00/lvol7 6144 2934 3184 48% /usr
/dev/vg00/lvol6 1024 26 989 3% /tmp
/dev/disk/disk80 20.0g 4292 14.8g 22% /sybase
/dev/vg00/lvol5 10.0g 5638 4565 55% /opt
/dev/vg01/ignite 22.0g 7742 13.5g 36% /ignite
/dev/vg00/lvol4 4096 1486 2589 36% /home
DevFS 0 0 0 100% /dev/deviceFileSystem
/dev/dumps/fsdump 997.6g 180 957.7g 0% /dumps

Look at the /dumps volume.

Many thanks. Patrick
James R. Ferguson
Acclaimed Contributor
Solution

Re: bdfmegs ver 5.0

Hi Bill:

It looks like some left-over 32-bit shell arithmetic was exposed by Patrick's data (immediately above this post of mine).

In your 'TGconv()' function, a potential fix is:

Instead of:

[ $SUMFLAG -eq 0 ] && NUM=$(($1/$DIV)) || NUM=$1

Substitute:

if [ $SUMFLAG -eq 0 ]; then
NUM=$(echo "$1 $DIV"|awk 'END{printf "%d", $1/$2}')
else
NUM=$1
fi

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: bdfmegs ver 5.0

Thanks James. It has been difficult to locate multi-terabyte filesystems for testing. I'll fix the code.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: bdfmegs ver 5.0

>JRF: It looks like some left-over 32-bit shell arithmetic was exposed by Patrick's data

On 11.23, if you use ksh, you get 64 bit arithmetic.
James R. Ferguson
Acclaimed Contributor

Re: bdfmegs ver 5.0

Hi (again) Bill:

> Thanks James. It has been difficult to locate multi-terabyte filesystems for testing. I'll fix the code.

Your code made this easy! Given Patrick's observation, it was trivial to kludge a bogus filesystem into one of 'bdf' output streams. No, I don't have any TB filesystems, either.

Then, I simply turned on the debugging trace framework you built and examined its output.

Having well written, well-documented code is always a pleasure to read, but when the author takes the time to add (and _LEAVE _IN_) a robust debugging framework, the benefits are enormous.

Thanks for the opportunity to help, Bill.

Regards!

...JRF...
PatRoy
Regular Advisor

Re: bdfmegs ver 5.0

James, the fix does seem to work:

[root@NCRCI]:/home/proy$ ./bdfmegs.sh
File-System Mbytes Used Avail %Used Mounted on
/dev/vg00/lvol3 1024 190 826 19% /
/dev/vg00/lvol1 1792 451 1329 25% /stand
/dev/vg00/lvol8 33.3g 16.7g 16.5g 50% /var
/dev/vg00/lvol7 6144 2934 3184 48% /usr
/dev/vg00/lvol6 1024 26 989 3% /tmp
/dev/disk/disk80 20.0g 4292 14.8g 22% /sybase
/dev/vg00/lvol5 10.0g 5638 4565 55% /opt
/dev/vg01/ignite 22.0g 7742 13.5g 36% /ignite
/dev/vg00/lvol4 4096 1486 2589 36% /home
DevFS 0 0 0 100% /dev/deviceFileSystem
/dev/dumps/fsdump 5093.6g 200.1g 4855.3g 4% /dumps

If anyone cares, I'm running HPUX 11.31.

Bill: I'll guess you'll be releasing a new version? :-)

Thanks again!

P.

Rita C Workman
Honored Contributor

Re: bdfmegs ver 5.0

So cool.....I've been a bit out of touch lately, but downloaded your bdfmegs and gave it a try on a couple file systems I have that are just over a terabyte. Works nice...

/dev/meta1/msarip 168.5g 49.8g 117.8g 30% /m-inprocess
/dev/meta1/mlib01 1011.1g 831.8g 177.9g 82% /m-lib01
/dev/meta1/mlib02 1011.1g 256.0g 749.2g 25% /m-lib02
/dev/meta1/mlib03 269.6g 991 266.6g 0% /m-lib03

Thanks Mr. Hassell, sorry I'll miss you and Patrick Monday since I'm taking one of the other seminars....but looking forward to Vegas!

Rgrds,
Rita
Bill Hassell
Honored Contributor

Re: bdfmegs ver 5.0

Here is the fixed version - 5.1


Bill Hassell, sysadmin
Patrick Ware_1
Super Advisor

Re: bdfmegs ver 5.0

Bill, when I try to run version 5.1, I am getting the following:

# bdfmegs
interpreter "/usr/bin/sh" not found
sh: bdfmegs: not found.

I've used previous versions, and never have seen this. Is there something I'm doing wrong?
Patrick Ware_1
Super Advisor

Re: bdfmegs ver 5.0

Nevermind, there were extra characters in the file...

Works good now.
Fabio Ettore
Honored Contributor

Re: bdfmegs ver 5.0

Hi Patrick Ware,

this happens when ftp'ing files in binary mode instead than ascii (and in this case the tool of Bill is an ascii file).

Hope this helps you in the future.

Best regards,
Fabio
WISH? IMPROVEMENT!
Fabio Ettore
Honored Contributor

Re: bdfmegs ver 5.0

...and compliments and thanks to Bill for this interesting tool!

Fabio
WISH? IMPROVEMENT!
Hakki Aydin Ucar
Honored Contributor

Re: bdfmegs ver 5.0

Hi Bill,

Thank you for this announcement, I 'd like to ask that if it is good for HP-UX 11i v1 ?

Bill Hassell
Honored Contributor

Re: bdfmegs ver 5.0

It has been tested with 10.xx and all versions of 11i.

I did fix a bug where the -N and -V options would match a partial VGname (as in vg01 and vg011) so attached is version 5.2.


Bill Hassell, sysadmin