Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I trying to read out CPU serial number information from a server which has FreeBSD.

I tried these with no effort:

  • sysctl
  • dmesg
  • cpucontrol

These utility is not exists on the system:

  • Dmidecode
  • Cpuinfo
  • cpuid
  • /proc directory

I cannot install any sotfware to the server.

Any idea how to solve it?

Thanks!

share|improve this question
    
Did you look at dmesg? In the CPU: part there is information about CPU features, stepping etc. –  arved Nov 12 '13 at 13:01
    
@arved The processor serial is not listed in the displayed messages at boot. –  Chris S Nov 12 '13 at 14:34
add comment

1 Answer 1

up vote 2 down vote accepted

The package "cpuid" exists on FreeBSD, but this is not part of the base system.

Output example:

root@freeBSD > cpuid
 eax in    eax      ebx      ecx      edx
00000000 00000005 756e6547 6c65746e 49656e69
00000001 000106e5 01040800 00000201 178bfbff
00000002 55035a01 00f0b2e4 00000000 09ca212c
00000003 00000000 00000000 00000000 00000000
00000004 0c000021 01c0003f 0000003f 00000000
00000005 00000000 00000000 00000000 00000000
80000000 80000008 00000000 00000000 00000000
80000001 00000000 00000000 00000001 28100800
80000002 65746e49 2952286c 726f4320 4d542865
80000003 37692029 55504320 20202020 20202020
80000004 30363820 20402020 30382e32 007a4847
80000005 00000000 00000000 00000000 00000000
80000006 00000000 00000000 01006040 00000000
80000007 00000000 00000000 00000000 00000000
80000008 00003024 00000000 00000000 00000000

Vendor ID: "GenuineIntel"; CPUID level 5

Intel-specific functions:
Version 000106e5:
Type 0 - Original OEM
Family 6 - Pentium Pro
Model 30 - Intel Corei7 or Xeon processor, 45nm
Stepping 5
Reserved 0

Extended brand string: "Intel(R) Core(TM) i7 CPU         860  @ 2.80GHz"
CLFLUSH instruction cache line size: 8
Initial APIC ID: 1
Hyper threading siblings: 4

Feature flags: 178bfbff:
FPU    Floating Point Unit
VME    Virtual 8086 Mode Enhancements
DE     Debugging Extensions
PSE    Page Size Extensions
TSC    Time Stamp Counter
MSR    Model Specific Registers
PAE    Physical Address Extension
MCE    Machine Check Exception
CX8    COMPXCHG8B Instruction
APIC   On-chip Advanced Programmable Interrupt Controller present and enabled
SEP    Fast System Call
MTRR   Memory Type Range Registers
PGE    PTE Global Flag
MCA    Machine Check Architecture
CMOV   Conditional Move and Compare Instructions
FGPAT  Page Attribute Table
PSE-36 36-bit Page Size Extension
CLFSH  CFLUSH instruction
MMX    MMX instruction set
FXSR   Fast FP/MMX Streaming SIMD Extensions save/restore
SSE    Streaming SIMD Extensions instruction set
SSE2   SSE2 extensions
HT     Hyper Threading

Feature flags set 2: 00000201:
SSE3     SSE3 extensions
SSSE3    Supplemental Streaming SIMD Extension 3

Extended feature flags: 28100800:
SYSCALL   SYSCALL/SYSRET instructions
XD-bit    Execution Disable bit
RDTSCP    RDTSCP and IA32_TSC_AUX are available
EM64T     Intel Extended Memory 64 Technology

Extended feature flags set 2: 00000001:
LAHF      LAHF/SAHF available in IA-32e mode

TLB and cache info:
5a: Data TLB: 2MB or 4MB pages, 4-way set associative, 32 entries
03: Data TLB: 4KB pages, 4-way set assoc, 64 entries
55: Instruction TLB: 2MB or 4MB pages, fully assoc., 7 entries
e4: 3rd-level cache: 8MB, 16-way set associative, 64-byte line size
b2: Instruction TLB: 4-KB Pages, 4-way set associative, 64 entries
f0: 64-byte prefetching
2c: 1st-level data cache: 32-KB, 8-way set associative, 64-byte line size
21: 256-KB L2 (MLC), 8-way set associative, 64 byte line size
ca: Shared 2nd-level TLB: 4-KB Pages, 4-way set associative, 512 entries
09: 1st-level instruction cache: 32KB, 4-way set assoc, 64 byte line size
Processor serial: 0001-06E5-0000-0000-0000-0000

I think the value you are looking for is this "Processor serial". So a simple cpuid |grep "Processor serial" would do the trick.

As you said you cannot install something on your server, you can still:

  • found a quite place like /tmp (if you want to keep trace/garbage low),
  • get the pre-compiled package:

    fetch ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages/misc/cpuid-3.3_6.tbz
    

    (adjust the URL with your server arch - see uname -a for more information)

  • extract the "cpuid" binary from it:

    tar -jxvf cpuid-3.3_6.tbz bin/cpuid`
    
  • and execute it locally:

    ./bin/cpuid
    
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.