[rrd-users] Re: HDD size

Hugo van der Kooij hvdkooij at vanderkooij.org
Sun Sep 7 20:26:04 MEST 2003

On Sun, 7 Sep 2003, yaka patiya wrote:

> Does anyone know about monitoring the size of a hard drive both total size 
> against used. I get some numbers when I do a SNMP walk on the mib file. But 
> what do I need to do if I want to show how many gigs are the total size and 
> how much is used? Do I multiply the result by 4096 since 1 allocation unit 
> is 4096 bytes. Then divide by 1024 to get kilobytes and then divide again by 
> 1024 to get mega bytes. And then finally divide by 1024 to get the answer in 
> giga bytes. Can some please help....And aslo does this same kind of 
> calculation be done on any hard drive ....regardless of the OS ?

I got a sample of code up at http://hvdkooij.xs4all.nl/stats/ which you 
may want to look into.

You need to get 3 variables to get the actual size + usages.
 1 being the unit size
 2 being the number of units for the device (partition)
 3 being the number of allocated units for the device

Total size = 1 * 2
Used = 1 * 3 

This is easily discovered by doing an snmpwalk over a device and dropping 
the results in a file. Studying this file has shown me al the nice options 
I can monitor.


 All email sent to me is bound to the rules described on my homepage.
    hvdkooij at vanderkooij.org		http://hvdkooij.xs4all.nl/
	    Don't meddle in the affairs of sysadmins,
	    for they are subtle and quick to anger.

Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list