Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coomand for Machine serial number

Status
Not open for further replies.

thebundies

Technical User
Dec 18, 2002
16
US
Is there a command to get the serial number of a SUN system running Solaris 8.
 
Nope, you just have to look for the label on the back of the system.

Sometimes the serial number is included as part of the default system-wide ethernet address/MAC. What model is it? Annihilannic.
 
Yeah, the following should help...
[tt]
#include <sys/systeminfo.h>

char buf[128];

if (sysinfo(SI_HW_SERIAL, buf, 128) == -1) {
perror(&quot;sysinfo&quot;);
exit(1);
}
[/tt]
See the man page for sysinfo.
 
I've also seen it done from the command line. There was some software I had installed quite a few years ago that needed the hardware serial number for their copy protection scheme. They would give you a &quot;key&quot; for the software so it would only run on that system.

I just can't quite remember the command.
 
Try the [tt]hostid[/tt] command. The man page says...
[tt]
NAME
hostid - print the numeric identifier of the current host

SYNOPSIS
/usr/bin/hostid

DESCRIPTION
The hostid command prints the identifier of the current host
in hexadecimal. This numeric value is likely to differ when
hostid is run on a different machine.
[/tt]
 
The hostid is the system MAC address. Nothing more...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top