Getting a machine's external IP address
Question: Looking for a better way to get a machines current external IP #... Below
works, but would rather not rely on an outside site to gather the information
... I am restricted to using standard Python 2.5.1 libraries bundled with Mac
OS X 10.5.x

    
    
    import os
    import urllib2
    
    def check_in():
    
        fqn = os.uname()[1]
        ext_ip = urllib2.urlopen('http://whatismyip.org').read()
        print ("Asset: %s " % fqn, "Checking in from IP#: %s " % ext_ip)
    


Answer: I wrote a module for that: [ipgetter](https://pypi.python.org/pypi/ipgetter).
Is designed to fetch your external IP address from the internet. It is used
mostly when behind a NAT. It picks your IP randomly from a serverlist to
minimize request overhead on a single server. Actually with 44 server and test
function to verify if the servers are returning the same IP.

<https://github.com/phoemur/ipgetter>

goes like this:

    
    
    >>> import ipgetter
    >>> IP = ipgetter.myip()
    >>> print(IP)
    'xxx.xxx.xxx.xxx'
    
    >>> ipgetter.IPgetter().test()
    Number of servers: 44
    IP's :
    'xxx.xxx.xxx.xxx' = 44 ocurrencies
    

