Any way to detect server model?

seth vidal skvidal at linux.duke.edu
Thu Mar 1 10:59:56 CST 2007


On Thu, 2007-03-01 at 08:50 -0800, Ray Van Dolson wrote:
> FYI, here's the awk script I ended up writing to pull this information out.
> Maybe useful to others down the line.
> 
> awk '
> BEGIN { RS = "\nHandle " ; FS = "[, ]" } 
> {
>   if (substr($1, 0, 6) == "0x0100") { 
>     match($0, "Product Name: ([^\n]+)")
>     rl = RLENGTH
>     a = substr($0, RSTART, RLENGTH)
>     match(a, ":")
>     print substr(a, RSTART+1, rl-RSTART)
>   }
> }
> '


I used something similar:

/usr/sbin/dmidecode | grep -i -C 8 'handle 0x0100' \
    | grep -i 'Product' | cut -d: -f2 | \
     sed -e 's/^\s*//' >> /etc/duke/model

-sv




More information about the Linux-PowerEdge mailing list