Novell ZENWORKS NETWORK ACCESS CONTROL 5.0 - 09-22-2008 User Manual page 353

Table of Contents

Advertisement

"""
--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."
_____________________________________________________________________________
try:
ports = []
if self.inputParams.has_key("ports_not_allowed"):
ports = self.inputParams["ports_not_allowed"].split(",")
else:
# No ports not allowed, pass
return(self.doReturn(returnHash))
_____________________________________________________________________________
if debug:
- 0 if an unexpected error occurred, 1 if
- pass, fail or some error
System Administration 353

Advertisement

Table of Contents
loading

This manual is also suitable for:

Zenworks network access control 5.0

Table of Contents