1845834 Members
4364 Online
110250 Solutions
New Discussion

dmesg and syslog

 
manu_15
Occasional Advisor

dmesg and syslog

Hi All,

Can anybody explain in detail ,what is the difference between dmesg and /var/adm/syslog/syslog.log

thanks in advance
8 REPLIES 8
Bill Hassell
Honored Contributor

Re: dmesg and syslog

dmesg reports the contents of the kernel message buffer. syslog is a general purpose logging facility and anyone can write messages to syslog (see man logger). syslog is an unrestricted file but dmesg only reports what is currently in the kernel message buffer--a small area in memory, about 50-100 lines. New messages push the oldest memories out of the buffer. There is no facility in HP-UX to monitor the message buffer so you have to create a cron job to track this buffer.


Bill Hassell, sysadmin
Senthil Kumar .A_1
Honored Contributor

Re: dmesg and syslog

No pointers for this please..

Have pasted what i found in MAN pages..

dmesg -

dmesg looks in a system buffer for recently printed diagnostic
messages and prints them on the standard output. The messages are
those printed by the system when unusual events occur (such as when
system tables overflow or the system crashes). If the - argument is
specified, dmesg computes (incrementally) the new messages since the
last time it was run and places these on the standard output. This is
typically used with cron (see cron(1)) to produce the error log

The system error message buffer is of small, finite size. dmesg is
run only every few minutes, so there is no guarantee that all error
messages will be logged.

syslog...

This log is used by a application or daemons to report the problem they encounter.
This is done by the apps by invoking "logger" command. A entry can be added to by syslog.log by user by invoking "logger" command. It can be considered as a feature provided by UNIX system for app vendor or
programmer to log into syslog.log file.

The logger command provides a program interface to the syslog() system
log module (see syslog(3C)).

A message can be given on the command line, which is logged
immediately, or a file is read and each line is logged. If no file or
message is specified, the contents of the standard input are logged.

Regards.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)
manu_15
Occasional Advisor

Re: dmesg and syslog

Hi All..

Thanks for the replies..I have some more doubts about the same. Does hardware alerts will logged into the syslog..Also explain the normal procedure we follow for hardware related problems ( I mean checking the logs)

Thanks....
manu_15
Occasional Advisor

Re: dmesg and syslog

hi...

sorry..the above link I'm no able to open..
Bill Hassell
Honored Contributor

Re: dmesg and syslog

Hardware diagnostics will be logged into syslog if the online diagnostics have been installed. Type this command to see the RAM installed in your system:

echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm

If you get a response that cstm was not found, you need to install the online diagnostics from your HP Support Plus CDROM.


Bill Hassell, sysadmin
Nguyen Anh Tien
Honored Contributor

Re: dmesg and syslog

Senthil Kumar .A_1
Honored Contributor

Re: dmesg and syslog

Hi manu,


i have attached a sample syslog file..
too bad ..i couldn't grep and sort it as some events spanned multiple days.. so i will not be able to present is in a fine manner.

But.. Usually.. the H/W issses reported by unix kernel(vmunix).. will be reported

date syatemname vmunix : Error

ex.. Please find more in the attachment.

Apr 3 15:15:35 unix_sys vmunix: ct_query failed. hw_path = 0/4/0/0

This doesn't go to say that , others wouldn't report H/W issues...Some daemons could report for example...for a tape drive,reported by veritas netbackup daemon.

Nov 28 11:58:19 bdhp4271 tldcd[1098]: TLD(40) key = 0x4, asc = 0x40, ascq = 0x1, HARDWARE ERROR, GENERAL..

so actually.. you need to get familiar with your system devices and daemons running.. and check how these are logged to syslog.. This
understanding will aid you in dechipering the syslog for issues in
future.

Regards.
Let your effort be such, the very words to define it, by a layman - would sound like a "POETRY" ;)