Is it possible to get a drive space monitor for freebsd?
I can't use a simple snmp monitor to check drive space, because there are several values to check and some math to do.
I have to first look up the storage I want to monitor in hrStorageDescr (.188.8.131.52.184.108.40.206.1) I want to monitor item 11.
Then I have to look up the allocation units for this storage hrStorageAllocationUnits.11. In this case, its 512.
Next, I have to find the value for hrStorageSize.11 (.220.127.116.11.18.104.22.168.22.214.171.124). In this case, its 2147483647.
Last, the hrStorageUsed.11 (.126.96.36.199.188.8.131.52.184.108.40.206) is needed. 818737456.
Now, we have to do the math.
Storage size is calculated by multiplying the allocation units by the storage size value to get the number of bytes. Then you have to divide by 1024 to get kb, divide that by 1024 to get MB, and again by 1000 to get a more readable GB value. In this case we end up with 1000GB or 1TB.
Repeat the same method with the storage used values, and then subtract the two to get the answer. ~600GB free.
Ideally, it would be possible for the user to plug in whatever oid was needed for each field, so it would work across almost everything. The math should be the same everywhere.