Because the limitation of snmp, when the disk space is more than 8TB, we will get the wrong value. Whether we use snmpwalk or snmpget, the results are all the same. Therefore, we need to restore the correct value.
If we get the disk space is A, and the block size is B.
if (A <0){
return (A + 4294967296) * B;
} else {
return A * B;
}
Then we will get the C.
If we want to calculate the disk space in GB.
return C * B / 1024 / 1024