Long uptime cause problem with caunters

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
User avatar
Gorbachov
Posts: 29
Joined: Sun May 04, 2008 12:20 pm
Contact:

Long uptime cause problem with caunters

Post by Gorbachov »

Hello friends,

I have several machines that soon will reach 500 days uptime.

Today for two of them was 497-th day of uptime. The machines are up and running but the graphs look bad. Take a look at the attachent.


The output of the SNMP request looks okey but the numbers that came from the servers look oddly small...

Code: Select all

07/22/2009 06:01:00 PM - CMDPHP: Poller[0] Host[13] DS[487] SNMP: v2: 192.168.2.21, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 1685054545
07/22/2009 06:00:52 PM - CMDPHP: Poller[0] Host[1] DS[494] SNMP: v2: 127.0.0.1, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 538341423
07/22/2009 06:00:20 PM - CMDPHP: Poller[0] Host[19] DS[489] SNMP: v2: 192.168.2.122, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 970367048
07/22/2009 06:00:18 PM - CMDPHP: Poller[0] Host[21] DS[491] SNMP: v2: 192.168.2.142, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 3336426087
[b]07/22/2009 06:00:14 PM - CMDPHP: Poller[0] Host[17] DS[493] SNMP: v2: 192.168.2.102, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 224553
07/22/2009 06:00:06 PM - CMDPHP: Poller[0] Host[16] DS[492] SNMP: v2: 192.168.2.101, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 323519[/b]
07/22/2009 06:00:05 PM - CMDPHP: Poller[0] Host[31] DS[789] SNMP: v2: 192.168.2.2, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 3069520555
07/22/2009 06:00:04 PM - CMDPHP: Poller[0] Host[18] DS[488] SNMP: v2: 192.168.2.121, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 2442037680
07/22/2009 06:00:04 PM - CMDPHP: Poller[0] Host[20] DS[490] SNMP: v2: 192.168.2.141, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 3285588858
07/22/2009 06:00:04 PM - CMDPHP: Poller[0] Host[14] DS[495] SNMP: v2: 192.168.2.22, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 2011504797
07/22/2009 06:00:02 PM - CMDPHP: Poller[0] Host[36] DS[1051] SNMP: v1: 192.168.1.40, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 262094333

07/22/2009 06:00:14 PM - CMDPHP: Poller[0] Host[17] DS[493] SNMP: v2: 192.168.2.102, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 224553
07/22/2009 06:00:06 PM - CMDPHP: Poller[0] Host[16] DS[492] SNMP: v2: 192.168.2.101, dsname: ucd_hrSystemUptime, oid: .1.3.6.1.2.1.25.1.1.0, output: 323519


This rows are the two servers. It looks like their counters "Restart".


Is this something connected to 32/64 bit counters? Or where is the problem...


Thanks in advance
Yasen
Attachments
Uptime graph...
Uptime graph...
Capture.JPG (32.3 KiB) Viewed 3306 times
User avatar
Gorbachov
Posts: 29
Joined: Sun May 04, 2008 12:20 pm
Contact:

Post by Gorbachov »

After small research it looks like, the counter of linux boxes reset but on old kernels? I have new kenel on red hat 5.1 and the console shows real uptime:

[root@ob-web1 ~]# uptime
15:39:05 up 497 days, 4:00, 1 user, load average: 0.12, 0.08, 0.08
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

There are multiple "uptimes". One is the server uptime, the other one I'm aware of is the uptime of the snmpd. On many distro's, the snmpd still will be restarted regularly, so both times will differ
Reinhard
User avatar
Gorbachov
Posts: 29
Joined: Sun May 04, 2008 12:20 pm
Contact:

Post by Gorbachov »

Hello Gandalf,

It looks like the problem is with the SNMPd do you know a way to resolve this "problem"?

I will dig if there is a version of SNMPd that can bare such big uptime.
User avatar
schurzi
Posts: 42
Joined: Sat Oct 11, 2008 8:45 am
Location: Germany
Contact:

Post by schurzi »

Hi Gorbachov,

I think this is a problem of 32-bit counters.

You are already using the right SNMP Value for getting the uptime. (The one which resets everytime SNMPd restarts would be .1.3.6.1.2.1.1.3.0 - sysUpTime)

If you do the maths, you will see that a 32-bit counter will reset in roughly 496 Days.

Timeticks is defined in the MIB "SNMPv2-SMI.txt"
-- hundredths of seconds since an epoch
TimeTicks ::=
[APPLICATION 3]
IMPLICIT INTEGER (0..4294967295)

Code: Select all

# echo "4292967295/100/60/60/24" |  bc
496
I don't know a SNMP counter that counts uptime in 64-bit.
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan
User avatar
Gorbachov
Posts: 29
Joined: Sun May 04, 2008 12:20 pm
Contact:

Post by Gorbachov »

Thanks schurzi,


It looks like I have to live with this :)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests