如何将gauge32转换为整数?

时间:2015-11-19 03:20:51

标签: snmp

任何人都可以帮助我吗?我正在尝试监控我的网络设备的湿度,我做了snmpwalk,它是: snmpget -v2c -cpublic -mALL 172.x.x.x .1.3.6.1.4.1.13742.4.2.x.x.x.x 它说: SNMPv2-SMI :: enterprises.13742.4.2.4.1.x.x = Gauge32:2147483647 那么gauge32意味着什么?有什么办法可以把它转换成整数吗?

1 个答案:

答案 0 :(得分:0)

您尝试轮询的MIB对象是在打开 [1]

PDU-MIB 中定义的
RelativeHumidity   ::= TEXTUAL-CONVENTION
           DISPLAY-HINT "d"
                   STATUS      current
                   DESCRIPTION
                       "Data type for reporting sensor readings and thresholds
                       associated with humidity sensors. Relative humidity is
                       expressed as percentage and is defined as the ratio of the
                       partial pressure of water vapor in a gaseous mixture of
                       air and water vapor to the saturated vapor pressure of water
                       at a given temperature."
                   SYNTAX Unsigned32 (0..100)

humidity                OBJECT-TYPE
                        SYNTAX        RelativeHumidity
                        MAX-ACCESS    read-only
                        STATUS        current
                        DESCRIPTION
                            "The value of the external humidity sensor reported
                            as relative humidity (a percentage)."
                        ::= { humiditySensorEntry 3 }

所以你的相对湿度应该在 [0..100]的范围内。可能有两个问题:

  1. 由于某种原因,NET-SNMP无法正确显示值
  2. SNMP代理未实现此对象,或未在设备上安装或禁用湿度传感器
  3. The PDU-MIB snapshot compiled using NetDecision MIB Manager