Extract hardware serial number


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Extract hardware serial number
# 1  
Old 07-27-2012
Extract hardware serial number

Dear community,
I'm on RHEL 5. Is there a way to extract CPU S/N, or other hardware S/N from bash?

My goal will be create a license file based on that hardware S/N, and make the script executable only on a specific machine!
So any other hardware related advices are welcome!

Thanks
Lucas
# 2  
Old 07-27-2012
First check out the model.

That kind of information is usualy obtained thru some vendor api commands like HP's hpasmcli coming with HP Proliant support pack for RHEL

For instance to get serial number :
Code:
hpasmcli -s "show server" | awk -F":" '/Serial No./ { print $NF } '

You might also want to take a look at dmidecode to get such information (of course you will have to parse it a bit to be used in scripts.)

Hope that helps
Regards
Peasant.
This User Gave Thanks to Peasant For This Post:
# 3  
Old 07-27-2012
dmidecode might be useful to retrieve such information from BIOS memory on PC Linux. It's not always the same, however.
This User Gave Thanks to Corona688 For This Post:
# 4  
Old 07-27-2012
Thanks both, however, most probably, hpasmcli is ok for me! Smilie
# 5  
Old 07-30-2012
For anyone interested in dell you can use the following to get the system service tag and express service codes in bash:

Code:
echo "Service tag: $(dmidecode -s system-serial-number)"
echo "Express service code: $((36#$(dmidecode -s system-serial-number)))"

Note: requires the dmidecode package installed (# yum install dmidecode)
This User Gave Thanks to Chubler_XL For This Post:
# 6  
Old 07-30-2012
Thank you, but I forgot to mention that RHEL runs on HP Blade 460, so HP utilities help me a lot to exctract serial numbers! Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help about bind serial number

Hello folks. Please let me understand the bind serial number. I am confuse. 13011321 ---------- Post updated at 08:32 AM ---------- Previous update was at 07:55 AM ---------- Thanks problem is solved. (1 Reply)
Discussion started by: learnbash
1 Replies

2. Solaris

Anyone know how to get Serial number with 1 command?

Solaris8 Anyone help? (27 Replies)
Discussion started by: frustrated1
27 Replies

3. Linux

Device serial number

Hey! I'm trying to figure out a sollution for a problem I have at my company with an Iomega MiniMax 500 GB USB disk. If i run cat /proc/bus/usb/devices I get this information: T: Bus=01 Lev=02 Prnt=04 Port=00 Cnt=01 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00... (2 Replies)
Discussion started by: noratx
2 Replies

4. Solaris

[help] how to get serial number of cpu or other hardware

hi experts, hi all, need help, how to get serial number of cpu or other hardware using command? does anybody know using what syntax? thank you wu (8 Replies)
Discussion started by: bucci
8 Replies

5. Solaris

Serial number

Hi Solarizer ;) I have face the difficulties of gathering information about the serial number of sun machine. i think its can do so easy while the machine is just one or two. But i have to administrate hundreds of sun machine. Any body knows how to gather this information by the command ? ... (4 Replies)
Discussion started by: tpx99
4 Replies

6. Solaris

Display Serial Number

Hello, I am running Solaris 9 and I need to display the serial number of my machine. How can I do this? Here is my machine info: SunOS birch 5.9 Generic_118558-09 sun4u sparc SUNW,Sun-Fire-V240 Thank you, David (5 Replies)
Discussion started by: dkranes
5 Replies

7. AIX

how to find serial number

hi how to find ( server machine )serial number throught the command in AIX thanks for your replay (3 Replies)
Discussion started by: chomca
3 Replies

8. Shell Programming and Scripting

Tape Serial Number

Hello Experts, I've got a shell script that makes the backup of the files that i want. I also have this script showing the amount of files backed up and in witch folders they are. It's only missing one thing. I got all the information beeing stored in a text file and all i've got to do is to... (6 Replies)
Discussion started by: jorge.ferreira
6 Replies

9. UNIX for Advanced & Expert Users

serial number for E3500

just wanted to know the serial number of my machine E3500 with Solaris 8 installed.Does any one who what's the command that i can use when the OS is running?( not with the Banner Command!) (3 Replies)
Discussion started by: i2admin
3 Replies
Login or Register to Ask a Question