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?

1

3 Answers 3

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.

1
  • 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.
    – floodpants
    Mar 8, 2013 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.

-2

Please execute the below command at shell.

last | grep down

2
  • 2
    This answer is not correct. Dec 23, 2013 at 17:44
  • I don't see down anywhere in the last output, whether for a normal restart or a simulated power failure restart. Dec 23, 2013 at 22:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .