#!/usr/bin/env python

import urllib2
import re
# this creates a password manager
url='http://test/nagios/cgi-bin/status.cgi?host=all'
User='admin'
Pass='123'
passman = urllib2.HTTPPasswordMgrWithDefaultRealm()    
passman.add_password(None, url, User, Pass)
# create the AuthHandler
authhandler = urllib2.HTTPBasicAuthHandler(passman)    
opener = urllib2.build_opener(authhandler)    
urllib2.install_opener(opener)
pagehandle = urllib2.urlopen(url)
data = pagehandle.read()
pagehandle.close()
f=re.search('.*load .*',data)
x=f.group()