Extreme Networks AG200 User Manual page 318

Version 5.0
Table of Contents

Advertisement

System Administration
Figure 157: checkOpenPorts.py script (continued)
session="+self.session.id()+"): ", sys.exc_type, sys.exc_value
not allowed open were open: " + portsOpen.rstrip(", ")
except:
#
# Always use the doReturn function. This will record test timings as
well as
# encode the result_message into a format compatible with
Sentriant AG
#
return(self.doReturn(returnHash))
318
s.close()
if debug:
print "Connected to "+hp+". Port open!"
#
# Add the port to our list of open ports for use later
#
portsOpen += str(p) + ","
except:
if s is not None:
try:
s.close()
except:
pass
import sys
print "checkOpenPorts(host="+self.session.host()+",
if debug:
print "Could not connect to "+hp+". Port not open."
# Good, it wasn't open
#
# There are ports open, so set the returnHash values
# to indicate that the endpoint failed the test.
#
if portsOpen != "":
returnHash["status_code"] = 1
returnHash["result_code"] = "fail"
returnHash["result_message"] = "The following ports that are
#
# Set the return status when exception occurs
#
import sys
returnHash['status_code'] = 0
returnHash['result_code'] = "unknown_error"
returnHash['result_message'] = sys.exc_type, sys.exc_value
return(returnHash)
Sentriant AG Users' Guide, Version 5.0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sentriant ag

Table of Contents