Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

CPU ID

by ralijani (Acolyte)
on Apr 16, 2003 at 05:38 UTC ( [id://250791]=perlquestion: print w/replies, xml ) Need Help??

ralijani has asked for the wisdom of the Perl Monks concerning the following question:

Is there any perl module than can detect CPU serial number or other unic hardware ID?

Replies are listed 'Best First'.
Re: CPU ID
by nite_man (Deacon) on Apr 16, 2003 at 06:10 UTC
    Try to use Sys::CPU, Linux::Cpuinfo, etc.
    CPAN is your the best friend!!!
          
    --------------------------------
    SV* sv_bless(SV* sv, HV* stash);
    
Re: CPU ID
by The Mad Hatter (Priest) on Apr 16, 2003 at 05:43 UTC
    A search on CPAN for "CPU" turns up a bunch of modules. Look through them and see if one does the trick.
Re: CPU ID
by PetaMem (Priest) on Apr 16, 2003 at 09:12 UTC
    I put the emphasis on other unic HW ID here:

    Under Linux (sorry, I don't have much knowledge with other OSes), you could do a quick&dirty trick by parsing the output of /sbin/ifconfig

    wlan0     Protokoll:Ethernet  Hardware Adresse 00:20:E0:8D:70:7D
    
    This will give you the MAC adresses of any attached networking devices. Pretty unique (most of the time). But as you can see above: Be carefull of localized output just match the last (xx:xx:xx:xx:xx) sequence - if any - of the lines not starting with a whitespace. THe regexp is left as an exercise. ;-)

    Bye
     PetaMem

      This will give you the MAC adresses of any attached networking devices. Pretty unique (most of the time). ...

      Holy microcode muck!

      MAC address better be unique across the universe all the time or we is in big doo doo.

      The MAC address will always be unique BUT change ethernet card and you change MAC.

      CPU serial numbering is quite controversial back in 1999/2000 Intel had plans to introduce serial numbered Willamette series chips, but they backed down.

      I do use MAC cross-ref'ed with IP as a 'not perfect' but 'good enough' asset management number.

      mitd-Made in the Dark
      I've always been astonished by the absurd turns
      rivers have to make to flow under every bridge.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://250791]
Approved by valdez
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-25 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found