?
Solved

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

Posted on 2012-09-10
6
Medium Priority
?
1,425 Views
Last Modified: 2012-09-10
Hi experts:

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

Red Hat 5 - Linux x86_64
errors.JPG
0
Comment
Question by:LindaC
  • 3
  • 3
6 Comments
 
LVL 6

Expert Comment

by:g3nu1n3
ID: 38382785
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
 
LVL 8

Author Comment

by:LindaC
ID: 38382797
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
 
LVL 6

Expert Comment

by:g3nu1n3
ID: 38382843
Is there a specific timestamp within dmesg that you are trying to figure out?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Author Comment

by:LindaC
ID: 38382857
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
 
LVL 6

Accepted Solution

by:
g3nu1n3 earned 2000 total points
ID: 38382865
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
 
LVL 8

Author Closing Comment

by:LindaC
ID: 38382877
Thank you.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Often times it's very very easy to extend a volume on a Linux instance in AWS, but impossible to shrink it. I wanted to contribute to the experts-exchange community a way of providing a procedure that works on an AWS instance. It can also be used on…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month16 days, 20 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question