Any way to detect server model?
Ray Van Dolson
rvandolson at esri.com
Thu Mar 1 10:50:32 CST 2007
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)
}
}
'
Just pipe the output of dmidecode to it. I had to use substr() instead of
using a third argument to match() because the awk in busy box (at least the
one that comes with RHEL4) doesn't support it.
Ray
On Wed, Feb 28, 2007 at 04:42:23PM -0800, Ray Van Dolson wrote:
> Thanks Thomas! Exactly what I needed.
>
> Ray
>
> On Wed, Feb 28, 2007 at 06:31:15PM -0600, Thomas_Chenault at dell.com wrote:
> > The model name of the server can be found in the output of `dmidecode'
> > in the `System Information' section.
> >
> >
> > Thomas
More information about the Linux-PowerEdge
mailing list