1833757 Members
3409 Online
110063 Solutions
New Discussion

viewing console messages

 
SOLVED
Go to solution
JUP
Regular Advisor

viewing console messages

I'm using HP-UX 11.00.
Is there a way where I can view any messages that were directed to the console (/dev/console) from various programs. I have a number of programs that write messages to the console and I would like it for my customer to go the the console and view these messages but as some messages may have scrolled of the top of the screen, it would be better to just view the one file. Is there a file that automatically logs everything written to the console. I have checked syslog.log and rc.log but not much help as these are system messages. Although my apps write to different log files I was hoping the console captures all its messages and saves it to a file.

Any help here would be appreciated.
Thanks in advance
PA
5 REPLIES 5
Michael Tully
Honored Contributor
Solution

Re: viewing console messages

You need to change the /etc/syslog.conf file.

See the syslogd man page, but here some examples:

mail.debug /var/adm/syslog/mail.log
*.info;mail.none /var/adm/syslog/syslog.log
*.alert /dev/console
*.alert root
*.emerg *

You can redirect these messages anywhere you wish, including email.

Make sure that you restart the syslog daemon after making the changes.

# kill -HUP `cat /var/run/syslog.pid`
Anyone for a Mutiny ?
JUP
Regular Advisor

Re: viewing console messages

Thanks Michael

but what level would my application messages be at. The man pages mentions emerg and alert but what about standard application messages that write to /dev/console ?

Also if I direct all console messages to /apps/messages.log then would this file need to cleared at each boot ?

PA
blal
Frequent Advisor

Re: viewing console messages

Hi

Check out /var/adm/syslog/syslog.log.If the required logs appear in this file , you can write a shell script to extract those files from syslog.log and put into your file.

Other option is that,If you have software like CRT , there is option to capture text.Just say the ouput file path, this file will be generated on your PC under the path you specify.

So do telnet to GSP,go to console and What ever coming in that telnet screen will be appaended to the file you specify.

regds,
baiju
Live and let live.
Michael Tully
Honored Contributor

Re: viewing console messages

Using the 'info' 'alert' and 'emerg' selections, all messages can be redirected to a message file. You could easily write a simple script that runs from cron that creates a new file each day, like:
/apps/messages.01 /apps/messages.02
Don't forget to re-start the syslog daemon as I demonstrated in my earlier response.
Anyone for a Mutiny ?
JUP
Regular Advisor

Re: viewing console messages

Thanks guys.