1834285 Members
2066 Online
110066 Solutions
New Discussion

Console messages

 
JAYAMOHAN.V.D
Occasional Advisor

Console messages

hi,
we have a HP 9000 K220 machine located at one of our remote office. we want to monitor the console messages of the same. can anybody tell me is there any way to redirect the console messages to a file ?

regards
jayamohan
7 REPLIES 7
eran maor
Honored Contributor

Re: Console messages

Hi

The command /etc/dmesg may be used to view the current message buffer
where console messages are kept. This buffer is circular such that
older messages will scroll off the top. To monitor (and log) data
that has been added to the message buffer while running, /etc/dmesg
has an option to 'remember' what additions have been made recently.

The command /etc/dmesg - (just the minus character) will report all
the differences between the first /etc/dmesg - command and subsequent
runs of the same command. This may be appended to a file for logging
and an example of this is provided in /etc/newconfig/crontab.root.

Here is an example to log messages using cron:

# log kernel diagnostic messages every 10 minutes
05,15,25,35,45,55 * * * * /etc/dmesg - >>/usr/adm/messages

root (superuser) may be added to cron with the command:

crontab /etc/newconfig/crontab.root

To view the latest logged information, the /bin/tail command may be
used as in:

/bin/tail /usr/adm/messages
love computers
Ravi_8
Honored Contributor

Re: Console messages

Hi,
i don't think so that we can store console messages in a file and retrieve the file often.

you can use web console thru which you can access the console of the system.
never give up
Alex Glennie
Honored Contributor

Re: Console messages

hpterm -C may also be of use .... though it won't output to a file but it will run remotely.

see man hpterm -C option + the Xconsoles section.

However you'd need an X enviroment for it to run on.
John Palmer
Honored Contributor

Re: Console messages

Which particular messages are you interested in?

Most interesting messages are written to the syslog (/var/adm/syslog/syslog.log).

At 11.00, 'dmesg' messages are written to the syslog also and are not subject to data loss due to buffer overflow when long messages are written.

Regards,
John
Bill McNAMARA_1
Honored Contributor

Re: Console messages

Try a tail -f /var/adm/syslog/syslog.log
to have a live updating syslog.

Bill
It works for me (tm)
Vincent Stedema
Esteemed Contributor

Re: Console messages

Hi,

/etc/syslog.conf contains lines similar to the following:

*.alert /dev/console
kern.debug /dev/console

What you can do is add a line for the same log level and let syslog redirect the messages to an alternate log file. Like this:

*.alert /dev/console
*.alert /var/adm/syslog/console.log
kern.debug /dev/console
kern.debug /var/adm/syslog/console.log

Then, make syslogd reread its configuration file: kill -HUP

HTH.

Regards,

Vincent
Bill McNAMARA_1
Honored Contributor

Re: Console messages