#
for name, value in options:
if name in ('-h', '--help'):
usage()
if name in ('-u', '--url'):
try:
argUrl = value
except Exception:
print "Unable to converting char URL\n"
if name in ('-s', '--status'):
try:
argStatus = value
except Exception:
print "Unable to converting char STATUS\n"
usage()
try:
Status_url = urllib.urlopen(argUrl).getcode()
#print "WEB: %s" % Status_url
except Exception:
print "GETLOADAVG UNKNOWN: Error while requesting this URL"
sys.exit(3)
if str(argStatus) == str(Status_url):
print "WEBURL OK: This %s state is %s" % (argUrl, Status_url)
print "0"
sys.exit(0)
else:
#print "weburl xx: the url is %s" % (argStatus)
print "WEBURL CRITICAL: This %s state is %s" % (argUrl, Status_url)
print "2"
sys.exit(2)