I'd like to collect filesystem space information using SNMP on Solaris 10 and Ubuntu 11.10. The problem is that SNMP doesn't seem to have an attribute that corresponds to the "Available" column in df
.
For example, here is the df -k
output of my local filesystem:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sdb1 36841040 13489312 21480268 39% /
And here are the relevant attributes from the SNMP daemon (as per the Net-SNMP documentation):
HOST-RESOURCES-MIB::hrStorageDescr.31 = STRING: /
HOST-RESOURCES-MIB::hrStorageSize.31 = INTEGER: 9210260
HOST-RESOURCES-MIB::hrStorageUsed.31 = INTEGER: 3372328
HOST-RESOURCES-MIB::hrStorageAllocationUnits.31 = INTEGER: 4096 Bytes
Now 9210260*4 = 36841040
, and 3372328*4 = 13489312
, which match the columns in the df
output. However, I can't see any attribute that corresponds to the "Available" column. Note that it's not just a matter of subtracting the two columns - the "Available" column seems to take into account some hidden overheads which vary per filesystem.
Is there a way to collect or calculate the "Available" column information using SNMP?
I think you need to do additional configuration on top of standard SNMP to get available space. The NET-SNMP documentation mentions the following:
So sounds like you just need to use UCD-SNMP-MIB instead of HOST-RESOURCES-MIB to get to dskTable instead of hrStorageTable.