Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a xen hvm vps with a console thats accessible using VNC. I'm wondering if there's any way of logging anything/everything that is sent to console? I'm trying to log the console cause my vps crashes everyday for some odd reason.

share|improve this question
add comment

3 Answers

up vote 5 down vote accepted

The typical solution for console logging is to configure your VM with a virtual serial console. This document appears to exactly address your scenario; it discusses how to enable and serial console output under Xen.

If you're using a VPS managed by someone else you may not be able to make the necessary changes to put this configuration in place (although it can't hurt to ask your service provider).

share|improve this answer
add comment

try to use sudosh or ttyrec. first try ttyrec , as its easy to use.

share|improve this answer
add comment

Another alternative is to use rsyslog and have it log kernel events to another server. Obviously, this won't help if the networking stack is the cause of your crashes but it will give you a remote log of all other kernel events.

you can do remote logging with old sysklogd but it's harder to set up and secure, and only runs over udp. rsyslog can do remote logging via udp or tcp.

I've used rsyslog to setup central log server (nice if you have lots of boxes to monitor), and also to set up pairs or triplets of servers that all log to each other with rules like the following on each:

if $fromhost-ip == '127.0.0.1' and $syslogfacility-text == 'kern' then @otherserver.hostname

PS: in my experience, most likely cause of crash is insufficient RAM. or some badly written CGI or php script using up all available RAM causing the kernel OOM killer to go postal.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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