title: How to check whether my server is UP and RUNNING using Python?
body: <p>How do I make a HTTP call to a particular URL in Python and then figure out that whether the server is UP and RUNNING or not.</p>
  
  <p>As I recently started working with Python so not sure of any such libraries.</p>
  
  <p>If I am opening the below URL - </p>
  
  <pre><code>http://dbx45.dc1.host.com:8082/console
  </code></pre>
  
  <p>then some page gets opened to me which means my server is UP and RUNNING. But if it is not UP and RUNNING, then it shows me like this on CHROME - </p>
  
  <pre><code>Oops! Google Chrome could not connect to http://dbx45.dc1.host.com:8082/console
  </code></pre>
  
  <p>And on FIREFOX - </p>
  
  <pre><code>Unable to connect
  Firefox can't establish a connection to the server at dbx45.dc1.host.com:8082
  </code></pre>
  
  <p>So how do I figure out this thing from the Python that whether my server is UP and RUNNING or not?</p>
  
  <p><strong>UPDATE:-</strong></p>
  
  <p>This is what I have tried so far - </p>
  
  <pre><code>status = urllib2.urlopen("http://dbx45.dc1.host.com:8082/console").read()
  print status
  </code></pre>
  
  <p>How do I simplify this to understand whether the server is UP and RUNNING or not?</p>