Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61559

Re: Script Request

References <CA+pMb3voGJPWrFKXQXTTh-QgYdgTDjK39x6iSFp5FMkfvJXJYQ@mail.gmail.com>
Date 2013-12-11 07:16 -0500
Subject Re: Script Request
From Larry Martell <larry.martell@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3892.1386764201.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Dec 11, 2013 at 6:53 AM, Jeff James <jeff@jeffljames.com> 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"

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Script Request Larry Martell <larry.martell@gmail.com> - 2013-12-11 07:16 -0500

csiph-web