マシンの現在の外部 IP を取得するためのより良い方法を探しています #... 以下は機能しますが、情報を収集するために外部サイトに依存したくありません ... Mac OS にバンドルされている標準の Python 2.5.1 ライブラリの使用に制限されています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)