Snmp 如何将量规32转换为整数?
有人能帮我吗?我正在尝试监测网络设备的湿度,我进行了snmpwalk,即: snmpget-v2c-cpublic-mALL 172.x.x.x.x.1.3.6.1.4.1.13742.4.2.x.x.x.x.x 它说: SNMPv2 SMI::enterprises.13742.4.2.4.1.x.x=Gauge32:2147483647Snmp 如何将量规32转换为整数?,snmp,Snmp,有人能帮我吗?我正在尝试监测网络设备的湿度,我进行了snmpwalk,即: snmpget-v2c-cpublic-mALL 172.x.x.x.x.1.3.6.1.4.1.13742.4.2.x.x.x.x.x 它说: SNMPv2 SMI::enterprises.13742.4.2.4.1.x.x=Gauge32:2147483647 那么,量规32意味着什么?有什么方法可以将其转换为整数吗?您尝试轮询的MIB对象在PDU-MIB中定义,来自raritan[] 因此,您的相对湿度应在[0.
那么,量规32意味着什么?有什么方法可以将其转换为整数吗?您尝试轮询的MIB对象在PDU-MIB中定义,来自raritan[] 因此,您的相对湿度应在[0..100]范围内。可能存在两个问题:
Gauge32在内部是一个无符号32位整数。你面临的问题是什么?转换成整数几乎是自动的。谢谢您的回复。我编辑了我的问题,可能是重复的
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 }