#549 closed defect (fixed)

CheckUpTime Wrong Time Convert

Reported by: mopp Owned by: mickem
Priority: 2 Milestone: 0.4.1
Component: CheckSystem Version: 0.4.0
Severity: Bugs Keywords:
Cc:

Description

The plugin (0.4.0.172) reports the following output with ShowAll:
Plugin Reports: OK: uptime: 18w 102d 2403:143190|'uptime'=11171600000;0;0

The output 102d 2403:143190 looks strange.
The system boot date was 3/26/2012, 3:41:00 AM.

uptime=11171600000
Sec=11171600000/1000=11171600
Min=11171600/60=186193,3333
Hour=186193,3333/60=3103,222222
Day=3103,222222/24=129,3009259
Week=129,3009259/7=18,47156085

So the output should be something like:
uptime: 18w 129d and not 18w 120d.

A server with 7 weeks uptime seems to be okay. Another server with 11 weeks uptime has the same problem. The problem with the strange output seems to start somewhere between 7 and 11 weeks.

Change History (7)

comment:1 Changed 10 months ago by mickem

Which command do you use?
Ie. check_nrpe and check_uptime or check_nt?

Michael Medin

comment:2 Changed 10 months ago by mopp

check_nrpe and check_uptime

comment:3 follow-up: Changed 10 months ago by mickem

Strange...

Applying the logic from the code manually I get:
18w 2d 7h...

But there is a lot of casting to and from int there so maybe there the logic gets flawed by the compiler somewhere...

comment:4 in reply to: ↑ 3 Changed 10 months ago by mopp

Can I do something like running the agent in debug mode. Or could you provide a version which creates more debug messages to identify the error?

comment:5 Changed 10 months ago by mickem

Nahh, once I get home from work I'll try the function and see...
I'll update with my findings...

comment:6 Changed 10 months ago by mickem

Sorry, didn't have time to look into this last night will do so this weekend...

comment:7 Changed 10 months ago by mickem

  • Resolution set to fixed
  • Status changed from new to closed

This will be resolved in next build of 0.4.1

Note: See TracTickets for help on using tickets.