0

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?

5

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.

  • 1
    /var/log/messages is probably going to be the best to start with, but it would be wise to get familiar with all the log files in there so you know what gets logged where. – drinxy Mar 8 '13 at 2:14
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.

-3

Please execute the below command at shell.

last | grep down

  • 2
    This answer is not correct. – 89c3b1b8-b1ae-11e6-b842-48d705 Dec 23 '13 at 17:44
  • I don't see down anywhere in the last output, whether for a normal restart or a simulated power failure restart. – Michael Hampton Dec 23 '13 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.