Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.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.031 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'jeff': 0.04; 'exception,': 0.09; 'try:': 0.09; 'cc:addr:python-list': 0.11; 'urllib': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'import': 0.22; 'cc:addr:python.org': 0.22; 'print': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'except': 0.35; 'skip:u 20': 0.35; 'received:google.com': 0.35; 'thank': 0.38; 'url:amazon': 0.38; 'morning': 0.39; 'sure': 0.39; 'company': 0.60; 'first': 0.61; 'our': 0.64; 'to:addr:jeff': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ENT2isJdtNfoe9HQxUjP7BYLvbj4iua1J547nncUB8s=; b=GcW2t4rjQQc+PXmyTiz7VdAqYMTLOZkm1ic/4XZ6ttQ89o+BpT4RLdzdh+BqYvfRad OSYlGVlivYOXrSecesXxfub5BnmfFokf8YnQTphVu0w5lW9/3vHmwfifYWVug3PFKwBg 0X53eVQPfpRhVz5/GsYXMwybA9LmuG6M+s/Th6G5dD70v/B+ORCFk/3vEQkUE3jUzT6V Vk5icsZWLJrIodQc6OKU6B10io8Lmtw80wTZndwQWYz3wx9JMVD/BBKrGSq128GEY6C0 qmCZz03PNEW/5wmQKF/qSV1ZwFMKnxFqMxyEProt6gg8NktrEQ/DmBJt5JF9ILNNmPYn kfpw== MIME-Version: 1.0 X-Received: by 10.194.219.1 with SMTP id pk1mr1204057wjc.36.1386764200148; Wed, 11 Dec 2013 04:16:40 -0800 (PST) In-Reply-To: References: Date: Wed, 11 Dec 2013 07:16:40 -0500 Subject: Re: Script Request From: Larry Martell To: Jeff James Content-Type: text/plain; charset=UTF-8 Cc: python-list@python.org 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: 15 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386764201 news.xs4all.nl 2873 [2001:888:2000:d::a6]:55201 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61559 On Wed, Dec 11, 2013 at 6:53 AM, Jeff James wrote: > Looking for a script which will check connectivity of any or all of our > company URL's first thing in the morning to make sure none or our sites are > down. Any suggestions ? Thank You import urllib sites = ["http://www.amazon.com/", "http://nowhere.com"] for site in sites: try: urllib.urlopen(site) print site + " is up" except Exception, e: print site + " is down"