Hi all,
here is a sed script to make ndmpdlog.yyymmdd log easier to read. it generate an html output with background color to quick identify errors recorded in the log. have a try
_______________________________________________________________________
#! /bin/sed -f
# DESCRIPTION # - This script convert a plain ndmpdlog.YYYYMMDD comming from a Netapp Filer (or compatible) to a nice html report. # - It write the result on stdout. # - For Un*x system or compatible. # SYNOPSIS # ndmpdlog2html.sed ndmpdlog.20030422 > anyfilename4output # OPTIONS # - you can focus the report only on error messages by uncomenting a line # - you can change enlight colors by modifying #hhhhhh fields # - you can uncomment the last line to enable very long reports # TODO # - embed this sed script in shell to incorpore as a title, the name of the log and the date in a more readable way # - add a java applet link that would mail the log to the Netapp support # - make coffee # HISTORY # - 22/04/2003 (europe date convention) version 1.0 # AUTHOR # - stephane bentebba # COPYRIGHT # - no copyright # - not supported # - feel free to enhance and distribute # SEE ALSO # - http://www.ndmp.org/download/ for the NDMP specifications # - http://www.netapp.com for Netapp products
# #### set up the HTML header 1i\ <HTML><HEAD><TITLE>Enlighted NDMP logs</TITLE></HEAD>\ <BODY><body bgcolor="#FFFFFF">\ <br><br>
# #### filter warnings : 'Error NDMP_*' /(.*[Ee]rror.*NDMP_NO_ERR.*)/{ s//<table border=0 cellpadding=0 cellspacing=0 width=600 bgcolor=#ddb422><tr><td><font color=black size=2>\1<br></td></tr></table>/ # #### comment out this line to ignore warning lines # d;n p;d }
# #### filter Errors : 'Error code: NDMP_*' lines (in fact all remaining lines containing '[Ee]rror' /(.*[Ee]rror.*)/{ s//<table border=0 cellpadding=0 cellspacing=0 width=700 bgcolor=#ff0000><tr><td><font color=black size=2>\1<br></td></tr></table>/ p;d }
# #### filter 'NDMP message' and 'Message NDMP_*' lines (avoiding '[Mm]essage replysequence | header' lines) /(.*[Mm]essage replysequence.*)/!{ /(.*[Mm]essage Header.*)/!{ /(.*[Mm]essage.*)/{ s//<table border=0 cellpadding=0 cellspacing=0 width=500 bgcolor=#32cd32><tr><td><font color=black size=2>\1<br></td></tr></table>/ # #### comment out this line to ignore message lines # d;n p;d } } }
# #### uncomment the single 'd' line to focus on Message, Warning and Error messages only /(.*)/{ s//<table border=0 cellpadding=0 cellspacing=0 width=400 bgcolor=#008080><tr><td><font color=black size=1>\1<br></td></tr></table>/ # d }
# #### to avoid output files being bigger than 16M (!) 100000q
# EXAMPLE # You can try it with that sample of an authentic ndmpdlog : # # Apr 22 02:43:48 [ndmpd:72]: Method 264 # Apr 22 02:43:48 [ndmpd:72]: ReplySequence 5 # Apr 22 02:43:48 [ndmpd:72]: Error NDMP_NO_ERR # Apr 22 02:43:48 [ndmpd:72]: Error code: NDMP_NO_ERR # Apr 22 02:43:48 [ndmpd:72]: Vendor: Network Appliance # Apr 22 02:43:48 [ndmpd:72]: Product: Network Appliance NDMP server # Apr 22 02:43:50 [ndmpd:72]: Revision: 3.0 # Apr 22 02:43:50 [ndmpd:72]: NDMP message type: NDMP_TAPE_OPEN # Apr 22 02:43:50 [ndmpd:72]: NDMP message replysequence: 6 # Apr 22 02:43:50 [ndmpd:72]: Message Header: # Apr 22 02:43:50 [ndmpd:72]: Sequence 0 # Apr 22 02:43:50 [ndmpd:72]: Timestamp 0 # Apr 22 02:43:50 [ndmpd:72]: Msgtype 1 # Apr 22 02:43:50 [ndmpd:72]: Method 768 # Apr 22 02:43:50 [ndmpd:72]: ReplySequence 6 # Apr 22 02:43:50 [ndmpd:72]: Error NDMP_NO_ERR # Apr 22 02:43:50 [ndmpd:72]: Error code: NDMP_IO_ERR # Apr 22 02:43:50 [ndmpd:72]: Device name: nrst0a # Apr 22 02:43:50 [ndmpd:72]: Mode: 0 # Apr 22 02:43:50 [ndmpd:72]: IOException: Input/output error # Apr 22 02:43:50 [ndmpd:72]: NDMP message type: NDMP_TAPE_OPEN # Apr 22 02:43:50 [ndmpd:72]: NDMP message replysequence: 7 # Apr 22 02:43:50 [ndmpd:72]: Message Header: # Apr 22 02:43:50 [ndmpd:72]: Sequence 0 # Apr 22 02:43:50 [ndmpd:72]: Timestamp 0
_______________________________________________________________________
-- jetez un oeil ici http://www.sensiva.com/ -- -- have a look here http://www.sensiva.com/ --