Page 1 of 1

Uptime over snmp wrong

Posted: Fri Jun 17, 2016 10:45 am
by comfone
Hi All

I would like to check when the server has been booted the last time or how log it is already running.

But I get three different values?!? (see below=

When is use the OID 1.3.6.1.2.1.1.3.0 i get 88 days.
When is use the OID .1.3.6.1.2.1.25.1.1.0 I get 18 days but
when I run uptime on the Server I get 515 days!

# uptime
17:38pm up 515 days 4:29, 1 user, load average: 0.00, 0.01, 0.05

# snmpget -v2c -cxxxxx hostname .1.3.6.1.2.1.25.1.1.0
HOST-RESOURCES-MIB::hrSystemUptime.0 = Timeticks: (156257837) 18 days, 2:02:58.37

snmpget -v2c -cxxxxx hostname 1.3.6.1.2.1.1.3.0
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (767329167) 88 days, 19:28:11.67


I would prefer to use snmp to check this value. Which value is the correct one?

Can you help?

Re: Uptime over snmp wrong

Posted: Fri Jun 17, 2016 1:09 pm
by hsmith
Can you give us some information about the device?

Re: Uptime over snmp wrong

Posted: Fri Jun 17, 2016 6:41 pm
by comfone
It's a Linux VM
cat /proc/version
Linux version 3.11.10-25-default (geeko@buildhost) (gcc version 4.8.1 20130909 [gcc-4_8-branch revision 202388] (SUSE Linux) ) #1 SMP Wed Dec 17 17:57:03 UTC 2014 (8210f77)

Re: Uptime over snmp wrong

Posted: Sun Jun 19, 2016 11:03 pm
by Box293
Uptime is how long the system has been running since boot. Sometimes this is the operating system, other devices might use the SNMP engine uptime.

hrSystemUptime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The amount of time since this host was last
initialized. Note that this is different from
sysUpTime in the SNMPv2-MIB [RFC1907] because
sysUpTime is the uptime of the network management
portion of the system."
::= { hrSystem 1 }

sysUpTime OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The time (in hundredths of a second) since the
network management portion of the system was last
re-initialized."
::= { system 3 }

hrSystemUptime is the correct one to be using, but why is it only 18 days when it's really 515 days AND the other one is 88 days.

http://fixunix.com/snmp/65375-sysuptime-32-bits.html

The maximum support number is 497.

497 + 18 = 515

So basically you're server has been running longer than the 32bit snmp counter can support.