Operating System - HP-UX
1820636 Members
1812 Online
109626 Solutions
New Discussion юеВ

Re: Power failures - determining server shutdown time

 
Manoj Sooka
Occasional Advisor

Power failures - determining server shutdown time

Greetings

I need to know,when there is a power failure and no UPS is connected to the server, how to determine the time that the server went down / the failure occurred.

Many thanks in advance
Manoj
7 REPLIES 7
Andreas Voss
Honored Contributor

Re: Power failures - determining server shutdown time

Hi,

with the command

who -r

you could look when the server has been started.

Also look into /etc/shutdownlog when the system was going down.
In the file /var/adm/syslog/OLDsyslog.log you can see what had happened before the last reboot.

Regards
Wim Rombauts
Honored Contributor

Re: Power failures - determining server shutdown time

I don't think you can. Since the server is going down immediately on a power failure, he has no way of logging a shutdown in any file.

/etc/shutdownlog only registers normal restarts or system panics, but in this situations the system shuts itself down.
Things like "who -r" or the startdate of your syslog.log file only show the time of the end of the power failure, when the system restarts, not the beginning of the power failure.

Maybe there are other logfiles on your system that are regularly changed (every minute, every few minutes ?). If they have a timestamp for every line in that logfile, you can detect a gap in the timestamps. This kind of logging is the only way of finding the start a a shutdown. maybe, if you have regular entries in syslog.log, you could check the last entry in this file to determine the shutdown time.
Ravi_8
Honored Contributor

Re: Power failures - determining server shutdown time

Hi, Manoj

/var/adm/syslog/OLDsyslog.log and /etc/shutdownlog files will gives you the information .
never give up
Frank Slootweg
Honored Contributor

Re: Power failures - determining server shutdown time

If you have set up dmesg(1M) as per its manual page, then /var/adm/cron/OLDlog will have the time within 10 minutes accuracy.
Bernie Vande Griend
Respected Contributor

Re: Power failures - determining server shutdown time

I agree with Wim.
If its a power outage, then things like the shutdown log will not contain anything, unless the system had a bit of time to log before it went down.
Otherwise, perhaps you have cron jobs that run alot, in that case the cron log may be helpful as to when the system went down. /var/adm/cron/log or perhaps other logs that get written to frequently would help give you a good idea anyway.
Ye who thinks he has a lot to say, probably shouldn't.
harry d brown jr
Honored Contributor

Re: Power failures - determining server shutdown time

Without a UPS, you are placing your server(s) at risk of serious failure. The cost alone to perform repairs and to get the server(s) back into a state of reliability far out weighs the cost of a UPS. HP, can cancel or raise the price of their service contract (if you have a service contract).
Live Free or Die
Sridhar Bhaskarla
Honored Contributor

Re: Power failures - determining server shutdown time

Some of many different ways -

1) Check uptime to find since when the system has been up and running.
2) who -r gives you the date and time when the system was last booted.
3) ll /etc/rc.log (check the time stamp)
4) head /var/adm/syslog/syslog.log - Time stamp the first entry - not 100% as syslog can be restarted anytime.
5) /etc/shutdownlog - may not give if the system was just powered off
6) ll /var/tombstones/ts99

-Sri
You may be disappointed if you fail, but you are doomed if you don't try