[HPADM] SUMMARY: Interpretation of HEX Numbers to CTD Numbers

From: Neil Paniraj (npaniraj@yahoo.com)
Date: Fri Mar 03 2006 - 10:39:05 EST


Please find the attached script Fellow System Admins.

I got a number of responses and thanks to everyone who
reponded in a few minutes. The one attached is a
tailor made script to find the ctd numbers.

Note: forwarded message attached.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

attached mail follows:


This script was written to do the translation for LBOLT messages but it
looks like you're using the same devices so will probably work for that.
You may be able to find the Windows executable at HP's site if you'd
prefer to use that over the script.

Name the script LBOLTdecoder.sh:

#!/bin/ksh
#
# Script to do LBOLT decodes.
# jlightne 2004-Jul-13 - Original write
# jlightner 2005-Jun-09 - Minor modifications to comments
#
# Usage: LBOLTdecoder <LBOLT number>
# Where: LBOLT number is an 8 digit hex number (or 10 digits if
# 0x prefix is included).
#
# This script is based on assumptions made after reviewing the results
of
# Don Vaughan's Windows executable's output.
#
# Known from Don Vaughan's executable:
# - The LBOLT seen will be in the form 0x12345678 where the numbers
following
# the 0x can be 0-F (1 through 16 hexadecimal).
# - The 0x is not needed for the decode.
#
# Assumptions based on testing done on the binary:
# -The first pair of numbers are the MAJOR number of the disk block
device.
# -The remaining 6 numbers are the MINOR number of the disk device.
# -The first pair of numbers from MINOR define the Controller (c)
number.
# -The third number from MINOR defines the Target (t) number.
# -The fourth number from MINOR defines the Disk (d) number.
# -The remaining numbers have nothing to do with the decode.

# Example: The LBOLT number seen is 0x1f242400.
# 0x = Designates the remaining as hex and is always there.
# 1f = This is the hex for MAJOR of block device. Hex 1f = Decimal 31
# 242400 = MINOR for device in hex.
# 24 = First pair of MINOR in hex. Hex 24 = Decimal 36 <-
Controller number
# 2 = Third number of MINOR in hex. Hex 2 = Decimal 2 <- Target
number
# 4 = Fourth number of MINOR in hex. Hex 4 = Decimal 4 <- Disk
number
#
# Based on above the block device should be MAJOR 31, Minor 0x242400 and
it is
# named /dev/dsk/c36t2d4
# Results of ls -ld /dev/dsk/c36t2d4:
# brw-r----- 1 bin sys 31 0x242400 Jul 8 07:01
/dev/dsk/c36t2d4
# Notice that the MAJOR and MINOR are as predicted.

# Set the input argument as a variable
#
LBOLT=$1
echo LBOLT is $LBOLT

# The number as presented in error messages is usually prepended with 0x
to
# let one know it is a hex number. Don Vaughan's binary requires you to
strip
# out the 0x. This script allows input of the full number.

# To allow script to be used like the binary it also allows for input of
# the number without the 0x. Accordingly a test is needed here to
determinf
# whether the 0x prefix was input. If not add it so the cuts below are
correct.
#
if [ ! `echo $LBOLT |cut -c1-2` = "0x" ]
then LBOLT=0x$LBOLT
fi
echo LBOLT is now $LBOLT

# Based on input and above assumptions define the Controller, Target and
Disk.
# Also convert hex a,b,c,d,e & f to upper case because bc doesn't
understand
# these hex "numbers" unless presented in upper case.
# Hexadecimal to decimal equivalents are: A=10, B=11, C=12, D=13, E=14 &
F=15
#
CNH=`echo $LBOLT |tr "[a-f]" "[A-F]"|cut -c5-6`
CN=`echo "ibase=16\n $CNH " |bc`
TNH=`echo $LBOLT |tr "[a-f]" "[A-F]"|cut -c7-7`
TN=`echo "ibase=16\n $TNH " |bc`
DNH=`echo $LBOLT |tr "[a-f]" "[A-F]"|cut -c8-8`
DN=`echo "ibase=16\n $DNH "|bc`

UNIXDEV=c${CN}t${TN}d${DN}

# Output the results:
# NOTE: The ls command output is ONLY valid if this script executed on
the
# server from which the LBOLT device originally came.
#
echo LBOLT DEV $LBOLT is UNIX DEV $UNIXDEV
ls -l /dev/*dsk/$UNIXDEV

-----Original Message-----
From: hpux-admin-owner@DutchWorks.nl
[mailto:hpux-admin-owner@DutchWorks.nl] On Behalf Of Neil Paniraj
Sent: Friday, March 03, 2006 8:19 AM
To: Neil Paniraj; hpux-admin@dutchworks.nl
Subject: [HPADM] Interpretation of HEX Numbers to CTD Numbers

Gentlemen:

Could someone tell me how I can intepret the following
Hex numbers to "ctd" numbers. I just want to check
these disks:

AUTOPATH: Warning: Failed to discover the device
0x1f043700. Cause: Device is Busy

AUTOPATH: Warning: Failed to discover the device
0x1f044000. Cause: Device is Busy

AUTOPATH: Warning: Failed to discover the device
0x1f063700. Cause: Device is Busy

AUTOPATH: Warning: Failed to discover the device
0x1f064000. Cause: Device is Busy

NEIL

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact
majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner:
owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse
only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse &
search)
--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:52 EDT