SNMP sysUpTime 计数器的长度是多少?

网络工程 思科 snmp
2021-07-25 05:24:24

Cisco SNMP sysUpTime 计数器的长度是多少?32位?

3个回答

sysUpTime 是一个 32 位计数器,将在 496 天后翻转。

snmpEngineTime (.1.3.6.1.6.3.10.2.1.3) 返回以秒为单位的正常运行时间,并且不应在 135 年内滚动。

snmpwalk -v2c -c xx 10.xx.xxx.xxx .1.3.6.1.6.3.10.2.1.3
SNMP-FRAMEWORK-MIB::snmpEngineTime.0 = INTEGER: 1701562 seconds

snmpwalk -v2c -c xx 10.xx.xxx.xxx sysUpTime
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (170158257) 19 days, 16:39:42.57

做了一个快速测试,看起来数据是一种“Timeticks”类型,它是一个 32 位整数。来自 RFC:

The TimeTicks type represents a non-negative integer which represents
the time, modulo 2^32 (4294967296 decimal), in hundredths of a second
between two epochs.  When objects are defined which use this ASN.1
type, the description of the object identifies both of the reference
epochs.

https://www.rfc-editor.org/rfc/rfc2578#section-7.1.8

[user@host ~]$ snmpwalk -v 2c -c $COMMUNITY $DEVICE sysUpTime
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (1342832478) 155 days, 10:05:24.78

Cisco v1 MIB 导入TimeTicks来自 RFC1155-SMI的定义这个 mib 是标准 snmp utils 的一部分(即不包括在 Cisco mib tarball 中)。在 RFC1155-SMI 中,TimeTicks定义为:

   TimeTicks ::=
       [APPLICATION 3]
           IMPLICIT INTEGER (0..4294967295)