[HPADM] SUMMARY: decoding the output of : getconf CPU_CHIP_TYPE

From: Erik Platzbecker (E.Platzbecker@its.tudelft.nl)
Date: Wed Apr 09 2003 - 12:05:01 EDT


all,

thanks to 'Robert.Binkley@acxiom.com' and 'balakumar@lucent.com' who both
sent me (extensive) script. Scripts that in part were more or less doing
what i wanted (though much, much more besides).

It seems that i am not the only one developing tools for gathering info
on system configurations, instead of using readily available ones like
'nickel' (from HP).

Anyway, i am attaching my own small script around 'getconf CPU_CHIP_TYPE'.
This works fine on any 11.* system but may require some more work to run
well on 10.* ...

regards,

-- 
----------------------------------------------------------------------------
 Erik Platzbecker                            | Phone: +31 (0)15-2783896
 A&I / Systems and Network Support           | T.FAX: +31 (0)15-2781086
 Dept. of Information Technology and Systems | room : LB 02.150
 Delft University of Technology              | email:
 PObox 5031, 2600 GA Delft, The Netherlands  | E.Platzbecker@its.tudelft.nl
========
#!/sbin/sh
OS_REL=`uname -r | sed -e 's/^[AB]\.//' -e 's/\..*//'`
cpu_type=paXXXX
if [ "$OS_REL" -ge 11 ]; then
    typeset -i2 bin
    bin=`getconf CPU_CHIP_TYPE`
    typeset -i16 hex
    hex=2#`echo $bin | sed -e 's/2#//' -e 's/.....$//'`
    model_num=`echo $hex | cut -c4-`
    case $model_num in
        b) cpu_type=PA7200   ;;
        d) cpu_type=PA7100LC ;;
        e) cpu_type=PA8000   ;;
        f) cpu_type=PA7300LC ;;
        10) cpu_type=PA8200   ;;
        11) cpu_type=PA8500   ;;
        12) cpu_type=PA8600   ;;
        13) cpu_type=PA8700   ;;
        14) cpu_type=PA8800   ;;
        15) cpu_type=PA8750   ;;
        *) cpu_type=paXXXX   ;;
        *) cpu_type=paXXXX   ;;
    esac
else
    model_num=`model`
    model_num=`echo $model_num | sed -e 's/^9000\///'`
    l=`expr length $model_num`
    if [ $l -gt 5 ]; then
        model_num=`echo $model_num | sed -e 's/^[78]..\///'`
    else
        model_num=`echo $model_num | sed -e 's/\/.*//'`
    fi
    if [ $model_num = B1000 -o $model_num = B2000 ]; then
        cpu_type=PA8500
    fi
    for sm in /usr/lib/sched.models /usr/sam/lib/mo/sched.models /opt/langtools/lib/sched.models
    do
        if [ -s $sm ]; then
            h=`awk '(NF>=3&&$1=="'$model_num'"){print $3;exit}' $sm`
            if [ -n "$h" ]; then
                cpu_type=$h
                break
            fi
        fi
    done
fi
echo $cpu_type
--
             ---> 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:28 EDT