LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 08-26-2012, 10:56 AM   #1
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Rep: Reputation: 57
List of dmesg Error Codes


Does anyone know where I can find a list of most or all possbile error codes that are displayed in dmesg?

I am working on a server verification script to run after we apply patches to systems and I want to be able to automatically detect and log all errors in dmesg without haveing to actually read it.

Thanks,
Jared
 
Old 08-26-2012, 11:36 AM   #2
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Hmm, not sure if such a thing exists. I think each module or component writes its own messages in its own formats. Most of them don't seem to have the kind of error codes that could be looked up in a list or used to drive automation.

What are you trying to do in the verification scripts? dmesg pretty much is "automatically detect and log all errors". I assume you want to get alerts to another system for error conditions?
 
Old 08-26-2012, 12:12 PM   #3
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Original Poster
Rep: Reputation: 57
Well after we apply patched/updates we always scan dmesg to see if there are bad config options, failed hardware messages, segfaults, etc. So I am just trying to cut out the time it takes to read all of the dmesg manually and just write anything suspicious found to a log I have. Eventually I will also do the same thing for other system logs such as /var/log/messages and things. But as of now dmesg is the hardest one to find issues with. So I want to get it knocked out first.

Essentially I have a script now that remotely checks a node to gather infomation about the health of the machine and writes it to a local log. The after it gets that information it displays dmesg and /var/log/messages for manual review. I want to be able to completely automate it so I can execute the script and jsut read the local log only.
 
Old 08-26-2012, 01:09 PM   #4
worm5252
Member
 
Registered: Oct 2004
Location: Atlanta
Distribution: CentOS, RHEL, HP-UX, OS X
Posts: 567

Original Poster
Rep: Reputation: 57
Here is an example of what I am trying to do

Sample dmesg stores as /tmp/dmesg.fake
Code:
time.c: can't update CMOS clock from 9 to 55
nfs: server leviticus02 not responding, still trying
nfs: server leviticus02 OK
ipv6: Unknown parameter `off'
set_rtc_mmss: can't update from 5 to 59
VMCIUtil: Updating context id from 0xffffffff to 0x3c7e92e8 on event 0.
portmap: server localhost not responding, timed out
RPC: failed to contact portmap (errno -5).
kjournald starting.  Commit interval 5 seconds
EXT3 FS on dm-3, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
kjournald starting.  Commit interval 5 seconds
EXT3 FS on dm-5, internal journal
EXT3-fs: mounted filesystem with ordered data mode.
Adding 1048568k swap on /dev/VG00/LV01.  Priority:-1 extents:1
Adding 1048568k swap on /dev/sde.  Priority:-2 extents:1
VMware memory control driver initialized
Clock: inserting leap second 23:59:60 UTC
Then I have a script like this
Code:
#!/bin/bash

HOST="$1"
DMESGFILE="/tmp/dmesg.$HOST"
LOG="dmesg.log"
ERRORS="'Unknown parameter' 'can\'t update CMOS clock' 'not responding' '0x' 'inserting leap second'"

while read line; do
	for i in $ERRORS; do
		echo $line | awk "/$i/"
	done 
done < $DMESGFILE
Then I can run
Code:
$ ./parse_dmesg.sh fake
And it will return this
Code:
time.c: can't update CMOS clock from 9 to 55
time.c: can't update CMOS clock from 9 to 55
set_rtc_mmss: can't update from 5 to 59
Clock: inserting leap second 23:59:60 UTC
 
Old 08-26-2012, 01:13 PM   #5
SecretCode
Member
 
Registered: Apr 2011
Location: UK
Distribution: Kubuntu 11.10
Posts: 562

Rep: Reputation: 102Reputation: 102
Well I would do it with regular expressions (in Perl or Python) not plain string matches ... but still I think you are going to have to cook up your own list of warning matches. I'm not aware of any general standards for errors in dmesg.

Anyone else?
 
Old 08-27-2012, 06:31 AM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,348

Rep: Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749Reputation: 2749
I'm pretty sure there's no std; get yourself a good thesaurus eg http://thesaurus.com/ and lookup words like "don't", "can't", "fail", "bad" & friends ...
Good luck, you're going to need it ...
You could try homing in on words related to whatever you just changed ...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How to compile .jar Java byte-codes into native machine codes? ilgaar Linux - Software 1 08-30-2010 12:52 AM
How to compile .jar Java byte-codes into native machine codes? ilgaar Linux - Software 6 08-28-2010 11:20 PM
List of Process status codes and meanings? tgp1994 Linux - Newbie 1 04-02-2010 04:53 PM
httpd error codes and custom error messages ninja master Linux - Software 1 01-02-2010 03:56 PM
Chmod Codes list AmdMhz Linux - Software 12 02-05-2004 11:52 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration