HP 800 User Manual page 373

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

Advertisement

#
# Make up a summary for the test. This will show up in the description
# field in the policy editor.
#
testSummary = "This test takes a list of ports that should NOT be found
open on the remote host. If any port is found open, this test will fail.
This script will only succeed if none of the undesired ports are found
open."
#
# These are the arguments to run the test. This is displayed in the
command
# line help.
#
testArguments = \
"""
--host=<hostname, IP, or NETBIOS>
--input ports_not_allowed=<comma delimited list of ports>
Example: <this script> --host=somehost --input
"ports_not_allowed=23,80"
"""
#
# All tests must define the runTest method with the self and the debug
# parameters.
#
def runTest(self,debug=0):
#
# All tests must call the initialize routine
#
self.initTest()
if debug:
print "Starting checkOpenPorts(host="+self.session.host()+",
session="+self.session.id()+")"
#
# Create a hash to store the return results.
# All tests must fill return a hash with the following keys:
#
#
status_code
successful
#
result_code
#
result_message - the message to display to the end-user
#
returnHash = {}
returnHash["status_code"] = 1
returnHash["result_code"] = "pass"
returnHash["result_message"] = "The ports were not open."
Figure 13-6. checkOpenPorts.py script (cont.)
- 0 if an unexpected error occurred, 1 if
- pass, fail or some error
System Administration
Adding Custom Tests
13-25

Advertisement

Table of Contents
loading

This manual is also suitable for:

Procurve nac 800

Table of Contents