Anthony Fajri

I am The Story of This Blog

Check the Disk Space Using SNMP

To check the disk space using SNMP, the 1st thing is you have to enable SNMP in the agent-host device. Then in the management-host device, you can run this thing :

snmpwalk -c community-name -v1 10.72.220.2

then take a look of the result carefully, you can find this result :
HOST-RESOURCES-MIB::hrStorageDescr.6 = STRING: G:\ Label:Local Disk Serial Number e8eed18c
HOST-RESOURCES-MIB::hrStorageAllocationUnits.6 = INTEGER: 4096 Bytes
HOST-RESOURCES-MIB::hrStorageSize.6 = INTEGER: 7861801
HOST-RESOURCES-MIB::hrStorageUsed.6 = INTEGER: 871398

so, the string #6 of the hrStorage is drive G in the Windows.
Its total capacity is 7861801 * 4096 = 32201936896 bytes = 29.99 GB (windows use GB for the capacity)
its used space is 871398 * 4096 = 3569246208 bytes = 3.32 GB

January 30th, 2007 Posted by Anthony Fajri | information technology | 2 comments

2 Comments »

  1. Cacti already provide data gatherer to monitor drive space via SNMP. Well, basicly the concept is just like this article, but it’s ready to use.

    Comment by achmadi | Australia Australia | January 30, 2007 | Mozilla Firefox 1.5.0.9 on Windows XP

  2. Thank you for sharing. I came to this site to read how things really are

    Comment by Buona | Russian Federation Russian Federation | February 7, 2009 | Internet Explorer 6.0 on Windows XP

Leave a comment