Operating System - HP-UX
1847253 Members
3852 Online
110263 Solutions
New Discussion

Reliable method wanted to retrieve hosts serial No.

 
Ralph Grothe
Honored Contributor

Reliable method wanted to retrieve hosts serial No.

Hi,

is there a reliable method that works on any HP enterprise server without the prerequisite of any extra software to retrieve the server's serial number?

I know of different ways but they all aren't reliable because they either only seem to work for non-legacy hardware, or do require some extra piece of software like the Support Tools Manager from the OnlineDiag bundle or a shipped manifest.

I usually use these two

# /opt/ignite/bin/print_manifest -o|awk '$1~/erial/{print$NF}'
GBM393824A

# echo "sc prod system;info;wait;il"|/usr/sbin/cstm|awk '/System Serial/{print$NF}'
GBM393824A


As said, both have thier drawbacks.
The first requires a valid manifest and not too old hardware, as well as root privileges.

The latter requires the installation of STM as part of the Online Diagnostics, but can be run by any user.
What is irritating is that the command blocks for quite a while as if whole bulk of system digging goes on behind the scenes.

I searched the WWW for other sites that promised to tackle this, but what I found was pretty disappointing.
Most such URLs claim that the host ID on HP-UX can be displayed either by "uname -i" or lanscan.
Both statements seem damnright false to me.
lanscan only prints the MAC addresses of discovered NICs and uname -i, even if converted to hex, something totally different.

# uname -i
690319332
# printf "%x\n" $(uname -i)
29256fe4
# printf "obase=16;%d\n" $(uname -i)|bc
29256FE4


On a Linux box I strace-d the hostid command for open, socket, connect syscalls but couldn't see where it was read from.
At least there still was the chance to get the sources of this command and have a look there.

Is there a general "hostid" command that preferably would yield the serial/host ID on most Unix derrivatives?
Or could one write such a small program?
What would be required to be done in such a program on a HP-UX system?

Thank you for your suggestions
Ralph
Madness, thy name is system administration
11 REPLIES 11
Patrick Wallek
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

First, you are assuming that the serial number for the machine is stored somewhere in some tpe of NVRAM. That is not always the case. Older hardware does not do that.

The 'uname -i' number is definitely not the same as the actual physical serial number of the machine.


The ONLY foolproof way to get the serial number for a machine is to go and look at it.

Ralph Grothe
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

So we ought to install webcams spotting the number plates in our bunkers?
Hm, I thought each piece of silicon with minimal computational "skills" would issue its manufacturer's identification if fed with an appropiate pattern of currents?
So there isn't an integrating ID for the whole ensemble of wired HP hardware that can be queried?
Madness, thy name is system administration
RAC_1
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

I trust on STM way. Again, CE/cell board replacement can affect this.

Anil
There is no substitute to HARDWORK
Geoff Wild
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

There's these commands:

/opt/hpsmc/common/bin/getsn

/usr/local/sysinfo/getsn


I believe first is installed with ISEE, and later with sysinfo301

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
James Odak
Valued Contributor

Re: Reliable method wanted to retrieve hosts serial No.

I have already relied on STM, running information on the system

Jim
Chris Vail
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

Ralph:
Now you know why OpenView Network Node Manager costs so much. And even that requires a client to run on each server in which you're interested.

AFAIK, there is no one single product that will work on all hardware regardless of manufacturer. A Sun utility won't work on an IBM, an IBM won't work on HP, etc. Thats why tools such as OV exist and why they cost so much (and are bloody hard to implement). The advantage of these (OV has lots of competition) is that they DO write clients for old and out-of-date hardware and software. Some of them are really quite good at collecting this data. Others provide little functionality at all.

It might be possible to write a small SNMP client yourself, then use some kind of freeware to collect the data. Were I you, thats where I'd start. Later, if you move to OV or a competitor, your clients will be compliant.

You might be able to Google up a SNMP Client. Try that. Its a common enough problem, somebody in the OpenSource community must've built one.


Chris
Lee Harris_5
Valued Contributor

Re: Reliable method wanted to retrieve hosts serial No.

One method we use (this was told to me recently by someone else and it works a treat) is...

echo "sel path system\nil\nexit" | /usr/sbin/cstm | grep "System Serial Number"

Ralph Grothe
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

Geoff,

where is getsn part of?
I ran a

# find / -type f -perm -0100 -name getsn

but didn't have a match.
What does ISEEE (to be taken literaly, i.e. "I see!" ;-) and sysinfo301 stand for?

Chris,

I prefer the freely available suit of Net-SNMP tools (and the namesake Perl module).
But I think I found a record in HP Knowledge Base decidedly stating that there was no SNMP support for serial number retrival yet.
Looks to me as if HP don't want too easy propagation of their serial Nos.

Generally I aggree that one probably cannot expect a universal tool for cross-platform hardware identification.
I regret that our site isn't employing OpenView, especially since we have so many HP-UX boxes.
But they decided on Tivoli, which only got halfway, and half-heartedly deployed, thus rendering most of its amply praised functionality useless.
What makes it even worse for us Unix admins is that the Tivoli administration was layed in the hands of Mainframe people.
Madness, thy name is system administration
Geoff Wild
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

Here's ISEE:

http://software.hp.com/portal/swdepot/displayProductInfo.do?productNumber=U2512AA

It replaced "Predictive". HP Instant Support Enterprise Edition (ISEE).

SysInfo collects configuration information about the current system.
It also checks for some common problems including stale mirrors (if
applicable). It sends its output to a logfile or to the display.

I run from cron like so:

# Run the sysinfo script
0 6 1 * * /usr/local/sysinfo/sysinfo -a -b -o /usr/tmp/`hostname`.sysinfo >/tmp/sysinfo.cron 2>&1

Rgds...Geoff


Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Dave Hutton
Honored Contributor

Re: Reliable method wanted to retrieve hosts serial No.

It's not real reliable but you can also do:
#getconf MACHINE_SERIAL

It seems to work 90% of the time on 11i boxes.
It's not even an option on 11.0 servers
I'm guessing it has to be set somewhere internally on the servers Management processors.

So it's not real reliable in our environment but it could be if everything in your shop is newish.


James George_1
Trusted Contributor

Re: Reliable method wanted to retrieve hosts serial No.

Hi

This is what I do ..

# echo "selclass qualifier system;info;wait;infolog" | cstm |egrep "System Serial Number"

Rgds / James
forum is for techies .....heaven is for those who are born again !!