Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to obtain the system shutdown time from Error Log ?

Status
Not open for further replies.

MacFaza

IS-IT--Management
Jul 10, 2000
27
AR
Hi!
Im working with AIX servers, and we have a couple of UX servers.
We need to obtain automatically the downtime time from the error log, with an script.
This script should filter the usefull information, and let me put the date, time, and up/down time in a text file.

Could anyone of you show me how is composed an error log of UX ?
With what command should i use to obtain it ?

Do you imagine another way to obtain this, without a commercial software ?

Thanks
Gustavo

Gustavo Faza
gfaza@usa.net

 
Hi MacFaza,

On HP-UX servers, on startup, the /var/adm/syslog/syslog.log is copied/moved to OLDsyslog.log in the same dir and syslog.log nullified. Thus you can gain the shutdown time by the last entry in OLDsyslog.log and the startup time from the first entry in syslog.log.

If you wanted this info remotely and I guess automatically, you could perhaps put scripts withing the startup and shutdown scripts ran by run levels defined in /etc/inittab to mail another server with a message. This could be an Exchange server for example. Message would have to be sent prior to sendmail stopping on shutdown and post to sendmail starting on boot.
This is only an idea, and based upon Sendmail being used and timing issues.
I'm sure that fellow tec-tip users cold suggest a better method.

I hope that I have understood your question in the correct way, and if so my info has been of a little use.

Kind Regards
Queenie
 
"/etc/shutdownlog" gives times and reasons for when the system was shutdown (not crashes etc.) "who -b" gives last startup time.

Using a small script running from "rc.d" you could record each boot to a file, and tail the "shutdownlog". This should result in a very simple to understand out.
 
Well,

If you really want to have a nice format of a Log which print out the server status when it was shutdown/crash and when it was online, I would suggest you to install some Monitoring software to handle this tasks. There are many free softwares which allows you to put all of your servers in just 1 Web browser or screen and you can look at all servers logs etc...

Good luck,
-David
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top