Operating System - HP-UX
1833882 Members
2126 Online
110063 Solutions
New Discussion

Re: Logging /dev/console activities into a file

 
SOLVED
Go to solution
Jacob_2
Advisor

Logging /dev/console activities into a file

How can I log stdin ,stdout & stderr on the console into a file.
Pls note that I want to keep a log of everything and anything comming on the console.
5 REPLIES 5
S.K. Chan
Honored Contributor
Solution

Re: Logging /dev/console activities into a file

From HP Knowledge Mine..

There is no standard tool on HP-UX to log all messages sent to the /dev/console device file to a file. You can write a C program using the ioctl() system call with the TIOCCONS argument as described by the ioctl(2) and termio(7) man pages. Some of the console messages can be accessed using the following methods:

Edit /etc/syslog.conf and add a line to direct all alert level messages going to /dev/console to a log file. Example:
*.alert /var/adm/console_messages

Restart syslogd with the command
$ kill -HUP `cat /var/run/syslog.pid`

Use the dmesg and cron commands to log system diagnostic messages to a file. See dmesg(1M).

On systems like the N-class you can access the console history through the GSP (Guardian Service Processor) CL command (Console Log).
Michael Tully
Honored Contributor

Re: Logging /dev/console activities into a file

Hi,

Have a look at configuring your /etc/syslog.conf
file to pick these messages up. All messages are generally logged to to your system log file in /var/adm/syslog/syslog.log

For the console messages have a different line

*.alert /var/adm/console_messages

HTH
-Michael
Anyone for a Mutiny ?
Jacob_2
Advisor

Re: Logging /dev/console activities into a file

It is not just the syslogd or any particular command sending the o/p to the console.
It is any o/p to the device /dev/console.Like having a parallel console (just a plain flat file).

thanks for the replies.
Frank Slootweg
Honored Contributor

Re: Logging /dev/console activities into a file

Do you use a GUI environment like CDE or VUE?

If so, you can use "hpterm -C" to open a console window and use the logging facility of hpterm(1) to log all output to a file ("-l" option).
Jacob_2
Advisor

Re: Logging /dev/console activities into a file


The console is 50miles away from my work place and I need to know/see the console/screen (it can be just a 700/9x or a Test station ).

The only connectivity I have is the network.

thanks for the replies