Uptime and boot time of Unix Suse 11 Linux reporting incorrect

HI All, I need help to have the issues fixed for the incorrect information of uptime reported by Bigfix for Suse Linux enterprise server. Please check the findings below and advise:-1:

root:servername /opt/BESClient/bin# ./qna
Default masthead location, using /etc/opt/BESClient/actionsite.afxm
Q: uptime of operating system
A: 2058 days, 06:07:10
T: 3524

Q: name of operating system
A: Linux SuSE Enterprise Server 11
T: 63

Q: boot time of operating system
A: Wed, 26 Feb 2014 22:38:43 -0500
T: 86

Q: ^C
root:servername /opt/BESClient/bin#
root@servername:/opt/BESClient/bin# uptime
04:46am up 105 days 15:48, 5 users, load average: 1.79, 1.72, 1.69

root@servername:/opt/BESClient/bin# uname -a
Linux servername 3.0.101-0.47.99-default #1 SMP Thu Mar 30 13:16:41 UTC 2017 (16b33c4) x86_64 x86_64 x86_64 GNU/Linux

@tarwaniv,

With regards to the uptime discrepancy, I canā€™t explain that. Perhaps @AlanM could weigh in on this?

The name of operating system would be pulling details from applicable /etc/*-release file on the endpoint. So for example, on one of my development BESRelays reports:

[username@servername ~]# cat /etc/centos-release
CentOS Linux release 7.7.**** (Core)

This is consistent with whatā€™s reported by the BESClient for the endpoint.

Hope this helps.

Best,
@cmcannady

Actually I donā€™t have issues with name pulling if the server, I could not able to fetch the correct uptime in number of days which I compare it for servers which have not been rebooted since 180 days and the report created has all false data because of this issue.

Check the value within the files /var/log/wtmp and/or /var/run/utmp
The output of ā€˜uptime of operating systemā€™ should be got from there ā€¦
If different from ā€˜uptimeā€™ command output, need to understand why the difference with the OS vendor ā€¦

You are absolutely right and unfortunately vendor is also looking for helpā€¦lol. Will see to what we reach on this issue and thanks a lot for your time on this.

Linux uptime command looks at file /proc/uptime and last reboot shows the reboot entry from /var/log/wtmp. The reboot entry is placed (I suppose) by init command and /proc/uptime shows uptime from the kernelā€™s point of view - from starting the 1st CPU. Nobody knows your system better then you, but I would trust the output of uptime. wtmp file is easy to manipulate and it starts on the same date, as it shows last reboot. It may be, that last doesnā€™t find any reboot entries at all and just reports the first entry of the file as last reboot time.

The time in ā€œwho -bā€ shows you when the system went down; thereā€™s
nothing to say that it wasnā€™t turned off for half a day.
You can always check details in syslog/messages.

Possible reason for difference :-
Iā€™ve seen this happen when the BIOS clock is out of sync. You can verify that by running:

$ hwclock --show Tue 20 Aug 2019 12:48:52 PM PDT -1.000516 seconds

If this is off you should sync it back up (using the --set option). If you notice this happening frequently you probably need to change the CR2032 on your motherboard http://www.hardwaresecrets.com/article/81

1 Like