1

I have dedicated server running centos 6.0, and apache and the mysql

all of a sudden for some reason server has gone down, so i had to reboot the server and it all worked back to normal,

However i am wondering how do i get following information, I tried to use "uptime" command this only gives me the time that the server is running what i need to find out is

1. Actual time the server went down ?
2. How long the server has been down ?

...etc

any ideas?

mahen3d
  • 4,682

3 Answers3

6

You look through the in files /var/log.

Even if you don't find the errors that caused the outage outright, most of the files will have timestamps so you'll see a big gap in them - from the time the outage started, until you rebooted it.

Of course, this only works if the server actually stopped running - such as a kernel panic. If it was something like a misconfigured network card, it would still have been writing to the logs.

If it's a fairly busy webserver, you can also look through the access logs to see when it was last accessed before the reboot.

Grant
  • 18,125
  • 14
  • 75
  • 104
6

This is why you need a monitoring system.


Check your logs. There should be a gap in timestamps when your server was down. From that gap, you can get the approximate time when it went down as well as the duration.

EEAA
  • 110,608
-2

Please execute the below command at shell.

last | grep down

jscott
  • 25,114
JIjo
  • 11