I have a linux server,in this i receive alarm as server has rebooted.
When i check uptime of the server it says that the server has rebooted but when i check output of who -b it says that the server rebooted very long back
Can some one help what is the issue here.
you must check date/time settings on your host.
- check your history related date.(date or TZ set)
- check boot scripts (is there any entry related ntpdate or date or TZ in rc.local or specific other scripts )
- check your ntpd script(if enable , `chkconfig --list ntpd`)
- check ntp.conf in main ntpd server (if use vmguest then check vmhost time settings)
- check your source files for who|last command (for any corruption /var/run/utmp and/or /var/log/wtmp)
and uptime most probably does not change..
# cat /proc/uptime|awk '{ split($1/3600, a, ".") ; x=a[2]*60/10000 ; printf "%d:%0.2d\n", a[1], x}'
13:25
# uptime|sed -n 's/.*up \([^ ]*\),.*/\1/p'
13:25
regards
ygemici
1 Like
this is known bug in 2.4 kernel
you can check the real uptime with
-bash-3.00$ last -xf /var/run/utmp runlevel
runlevel (to lvl 3) Wed Jan 12 15:11 - 08:45 (150+16:33)
utmp begins Wed Jan 12 15:11:58 2011
-bash-3.00$
So this node is up 150days.
The bug report
1 Like
Thnx for the help.