Q: How do I email console messages or display them on a remote terminal?

I have a system running remotely in a computer room and there is normally no one sitting at the console. How can I make sure console error messages get emailed to me or at least are displayed on a remote login window?

A: System messages are logged using the "syslogd" facility. Most messages of interest are written by syslogd to the file /var/log/messages by default. Some messages are also written to the console. The file /etc/syslog.conf tells syslogd what to do with a message depoending on who generated the message and the error level of the message. (See "man syslog.conf".) Part of the entry in /etc/syslog.conf is an "action" to take for the message. The most common action is to write the message to a file. You can also send the message to a program, e.g. mail. For example:

*.=crit;kern.none |mail root

sends the error message to root. You can also direct messages to other logins instead of the console. e.g. if you are logged in remotely as root, you may want all messages also directed to your root login window. See "man syslog.conf" for some examples of different message logging.