用snmp获取磁盘信息的时候,当硬盘大小超过16T,导致HOST-RESOURCES-
参考这里:https://bugzilla.redhat.com/show_bug.cgi?id=654384
解决办法就是修改/etc/snmp/snmpd.conf
增加一行
realStorageUnits 0
realStorageUnits默认为1
贴一下解释,直接拷贝的 man snmpd.conf
realStorageUnits
controlls how the agent reports hrStorageAllocationUnits, hrStorageSize and hrStorageUsed in hrStorageTable. With
this option set to ’0’, the agent re-calculates these values for big storage drives with small allocation units so
hrStorageAllocationUnits x hrStorageSize gives real size of the storage.
Example:
Linux xfs 16TB filesystem with 4096 bytes large blocks will be reported as hrStorageAllocationUnits = 8192
and hrStorageSize = 2147483647, so 8192 x 2147483647 gives real size of the filesystem (=16 TB).
Setting this directive to ’1’ (=default) turns off this calculation and the agent reports real hrStorageAllocatio-
nUnits, but it might report wrong hrStorageSize for big drives because the value won’t fit into Integer32. In this
case, hrStorageAllocationUnits x hrStorageSize won’t give real size of the storage.

当使用SNMP获取超过16TB的磁盘信息时,由于HR-RESOURCES-MIB中hrStorageSize为32位整型导致计算错误。参考Red Hat的Bugzilla,解决方案是在/etc/snmp/snmpd.conf中添加一行'realStorageUnits 0'。这将使SNMP重新计算大存储驱动器的hrStorageAllocationUnits、hrStorageSize和hrStorageUsed,以确保其乘积反映出真实的存储大小。
694





