How to know the dates of the errors shown in the command dmesg ?

Hi experts:

How to know the dates of the errors shown in the command dmesg ?

Red Hat 5 - Linux x86_64
errors.JPG
LVL 8
LindaCAsked:
Who is Participating?
 
g3nu1n3Connect With a Mentor Commented:
This is probably what you are looking for: "dmesg reads the Kernel log ring buffer. It doesn't do timestamps. What you should do is configure syslog to grab the kernel logs from that buffer and send them to a file (if it isn't already set to do so). Note, default CentOS 5.x syslog config sends kernel logs to /var/log/messages, as I recall."

"If you'd like to send all kernel (dmesg) logs to /var/log/kern.log, using the default syslog daemon, you'd add a line like the following to /etc/syslog.conf"

kern.*            /var/log/kern.log

CentOS and RHEL are essentially the same. If you don't see /etc/syslog.conf try /etc/rsyslog.conf
0
 
g3nu1n3Commented:
I am not sure which timestamp you are trying to convert but I can give you something whereby you can expand on if necessary. At the beginning of the dmesg output you will see a timestamp; similar to this:
[root@srv ~]# dmesg | head -3
Initializing cgroup subsys cpuset
Initializing cgroup subsys cpu
Linux version 2.6.32-279.5.2.el6.x86_64 (mockbuild@c6b10.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Fri Aug 24 01:07:11 UTC 2012
[root@srv ~]#

Open in new window


Being that it is UTC, you can use an online UTC converter to determine your offset and then any further timestamps within can be determined in light of the offset.

Here are two online tools, the first being for your direct question and the other in helping with converting epoch time which is often seen in Linux timestamps.

http://www.timeanddate.com/worldclock/converter.html
epochconverter.com
0
 
LindaCAuthor Commented:
This is what I got, but still no timestamp.
I'am located in Ast-4 Atlantic Standard Time

b2bprddb1.prt.local:/home/oracle> dmesg | head -3
:1: SCSI error: return code = 0x00010000
end_request: I/O error, dev sdi, sector 0
Buffer I/O error on device sdi, logical block 0
b2bprddb1.prt.local:/home/oracle>
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
g3nu1n3Commented:
Is there a specific timestamp within dmesg that you are trying to figure out?
0
 
LindaCAuthor Commented:
I can't see none! see the output, where is the time - date?


b2bprddb1.prt.local:/home/oracle> dmesg | head -3
:1: SCSI error: return code = 0x00010000
end_request: I/O error, dev sdi, sector 0
Buffer I/O error on device sdi, logical block 0
b2bprddb1.prt.local:/home/oracle>
0
 
LindaCAuthor Commented:
Thank you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.