<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Dec 16, 2013, at 6:40 AM, Jeff James <<a href="mailto:jeff@jeffljames.com">jeff@jeffljames.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">So I'm using the following script to check our sites to make sure they are all up and some of them are reporting they are "down" when, in fact, they are actually up.   These sites do not require a logon in order for the home page to come up.  Could this be due to some port being blocked internally ?  Only one of the sites reporting as down is "https" but all are internal sites.  Is there some other component I should be including in the script ?  There are about 30 or 40 sites that I have listed in all.  I just use those in the following script as examples.   Thanks
<div><br></div><div><div>import urllib</div><div><br></div><div>sites = ["<a href="http://www.amazon.com/">http://www.amazon.com/</a>", "<a href="https://internalsite.com/intranet.html">https://internalsite.com/intranet.html</a>", etc.]</div>
<div><br></div><div>for site in sites:</div><div>    try:</div><div>        urllib.urlopen(site)</div><div>        print site + " "</div><div>    except Exception, e:</div><div>        print site + " is down"</div>
</div></div>
-- <br><a href="https://mail.python.org/mailman/listinfo/python-list">https://mail.python.org/mailman/listinfo/python-list</a><br></blockquote></div><br><div>I've never used urllib, although I've done a fair amount of network programming at lower levels.</div><div><br></div><div>Are you sure the report of "down" isn't simply a time out due to the server being busier than you expect when you hit it?</div><div><br></div><div>-Bill</div></body></html>