hostid?

Skip Montanaro skip at pobox.com
Sat Oct 19 19:20:29 EDT 2002


    Lance> Thanks all for the advice.. but I'm still not getting the hostid
    Lance> to which I refer. At work we use the Flexlm license manager. It
    Lance> requires users to send us the hostid of their computer. For
    Lance> example, the computer on which I write this has hostid
    Lance> 00d009b88fca and the hostname is the name of my computer which is
    Lance> MYNEWBOX.

I seem to recall that Sun's had a CPU-specific hostid.  I just checked on a
Sun I have access to.  It has a "hostid" command.  So does Linux, at least
the Mandrake and Red Hat systems to which I have access.  My Mac (OS 10.2.1)
doesn't.)

Why not just encapsulate it in a function?

    def hostid():
        return os.popen("hostid").read().strip()

If executing the hostid command isn't an option, you could write a little
extension module which calls the gethostid() library function.  Both Linux
and Solaris seem you have it.

-- 
Skip Montanaro - skip at pobox.com
http://www.mojam.com/
http://www.musi-cal.com/




More information about the Python-list mailing list