HP 800 User Manual page 375

Network access controller
Hide thumbs Also See for 800:
Table of Contents

Advertisement

except:
session="+self.session.id()+"): ", sys.exc_type, sys.exc_value
#
# 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
not allowed open were open: " + portsOpen.rstrip(", ")
except:
#
# 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)
#
# Always use the doReturn function. This will record test timings as
well as
# encode the result_message into a format compatible with NAC 800
#
return(self.doReturn(returnHash))
Figure 13-6. checkOpenPorts.py script (cont.)
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) + ","
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
3.
Once you have completed your test script modifications, save the script
as described in step 6 on page 13-15.
System Administration
Adding Custom Tests
13-27

Advertisement

Table of Contents
loading

This manual is also suitable for:

Procurve nac 800

Table of Contents