Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'jeff': 0.04; 'handler': 0.05; 'subject:Question': 0.07; '-0500': 0.09; 'exception,': 0.09; 'try:': 0.09; '"is': 0.16; 'blocked': 0.16; 'internally': 0.16; 'listed,': 0.16; 'logon': 0.16; 'specifying': 0.16; 'substituted': 0.16; 'url:my': 0.16; 'urllib': 0.16; 'when,': 0.16; 'component': 0.16; 'exception': 0.16; 'all.': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'url:default': 0.19; 'import': 0.22; 'print': 0.22; 'mon,': 0.24; 'question': 0.24; 'script': 0.25; '>': 0.26; 'am,': 0.29; 'reporting': 0.29; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; '"': 0.31; 'sites.': 0.31; 'up.': 0.33; 'date:': 0.34; 'could': 0.34; 'subject: (': 0.35; 'except': 0.35; 'skip:u 20': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'thanks': 0.36; 'should': 0.36; 'email addr:python.org': 0.37; 'being': 0.38; 'skip:& 10': 0.38; 'url:amazon': 0.38; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'skip:- 10': 0.38; 'skip:& 20': 0.39; 'subject:': 0.39; 'sure': 0.39; 'to:addr:python.org': 0.39; '8bit%:6': 0.40; 'show': 0.63; 're:': 0.63; 'our': 0.64; 'email name:python-list': 0.65; 'due': 0.66; 'home': 0.69; 'fact,': 0.69; 'url:asp': 0.77; 'etc.]': 0.84; 'examples.': 0.84; 'subject:James': 0.84; 'url:west': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:message-id:subject:from:to:content-type; bh=MYMERXzUyRihgCOULtyD/ksTBMeMtfNREQ6MotamcUo=; b=r4CbeJsJIUt3wMUMtpHEfKVrRXuoa8uUMplx4qZENmH++Wb4fJlWyBz4/COXPYkKzN ffSF1FT2j/9XWmnQVjKIeMF8ox76B1bfDlfdND9X0ILq0a44zmQBYsBlSzwW5a/EUNd8 VBrgX9IcdjBwlphBDoqjbew5pQvMB4FLqNXiOd0tR8RhhrdnMsvmWyyDzICM1gEkFXId KTFKHvQWDhp57Dku8SpNB6ZhpxpY9DRNQ31qXpen2lGXOQBqw/dNC6XYTJ+eC5250isy 2ufU5jA4UyWXAzkaJ+RZiECsiO3nM10D2/fwBCVyWj8G0+qdlY/m6CvcNcfTV8dK03NH P9fA== MIME-Version: 1.0 X-Received: by 10.60.79.105 with SMTP id i9mr427972oex.79.1387199350776; Mon, 16 Dec 2013 05:09:10 -0800 (PST) Sender: jljames@gmail.com Date: Mon, 16 Dec 2013 06:09:10 -0700 X-Google-Sender-Auth: SXkMnGIcCnIqkyMVbEPn9UYfZAw Subject: Re: Question Re urllib (Jeff James) From: Jeff James To: python-list@python.org Content-Type: multipart/alternative; boundary=089e01228590892af204eda6849e X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 157 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1387199359 news.xs4all.nl 2961 [2001:888:2000:d::a6]:36934 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:62058 --089e01228590892af204eda6849e Content-Type: text/plain; charset=ISO-8859-1 I'm not really receiving an "exception" other than those three sites, out of the 30 or so I have listed, are the only sites which show "is down" at the end of that line specifying the site. Where " # " has been substituted for our domain name........ https://my.####.com/intranet.html* is down* http://#####.main.####.com/psso/pssignsso.asp?dbname=FSPRD90 * is down* http://sharepoint.####.com/regions/west/PHX_NSC/default.aspx * is down* Cc: python-list@python.org Date: Mon, 16 Dec 2013 06:54:48 -0500 Subject: Re: Question RE urllib On Mon, Dec 16, 2013 at 6:40 AM, Jeff James wrote: > 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 > > import urllib > > sites = ["http://www.amazon.com/", "https://internalsite.com/intranet.html ", > etc.] > > for site in sites: > try: > urllib.urlopen(site) > print site + " " > except Exception, e: > print site + " is down" In the handler print out the exception you are getting. --089e01228590892af204eda6849e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I'm not really receiving an "exception" othe= r than those three sites, out of the 30 or so I have listed, are the only s= ites which show "is down" at the end of that line specifying the = site.

Where " # " has been substituted for our domain na= me........

http://= #####.main.####.com/psso/pssignsso.asp?dbname=3DFSPRD90 is down



Cc:=A0python-list@pyt= hon.org
Date:=A0Mon, 16 Dec 2013 06:54:48 -0500
Subject:=A0Re: Question RE u= rllib
On Mon, Dec 16, 2013 at 6:40 AM, Jeff James <jeff@jeffljames.com> wrote:
> 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. =A0 These sites do not require a logon in order for = the home
> page to come up. =A0Could this be due to some port being blocked inte= rnally ?
> Only one of the sites reporting as down is "https" but all = are internal
> sites. =A0Is there some other component I should be including in the = script ?
> There are about 30 or 40 sites that I have listed in all. =A0I just u= se those
> in the following script as examples. =A0 Thanks
>
> import urllib
>
> sites =3D ["http://www.amazon.com/", "https://internalsite.com/intranet.h= tml",
> etc.]
>
> for site in sites:
> =A0 =A0 try:
> =A0 =A0 =A0 =A0 urllib.urlopen(site)
> =A0 =A0 =A0 =A0 print= site + " "
> =A0 =A0 except Exception, e:
> =A0 =A0 =A0 =A0 print site + = " is down"

<= span style=3D"font-family:arial,sans-serif;font-size:12.800000190734863px">= In the handler print out the exception you are getting.
--089e01228590892af204eda6849e--