Plugins code cleanup + refactoring 0.2

This commit is contained in:
Jokob-sk
2023-09-01 22:03:32 +10:00
parent b5e933ba12
commit a379054f5b
11 changed files with 191 additions and 460 deletions

View File

@@ -34,7 +34,7 @@ def main():
# Plugin_Objects is a class that reads data from the RESULT_FILE
# and returns a list of results.
results = Plugin_Objects(RESULT_FILE)
plugin_objects = Plugin_Objects(RESULT_FILE)
# Print a message to indicate that the script is starting.
mylog('debug', ['[NMAP Scan] In script '])
@@ -55,7 +55,7 @@ def main():
for entry in entries:
results.add_object(
plugin_objects.add_object(
primaryId = entry.mac, # MAC (Device Name)
secondaryId = entry.port, # IP Address (always 0.0.0.0)
watched1 = entry.state, # Device Name
@@ -67,7 +67,7 @@ def main():
)
# generate last_result.log file
results.write_result_file()
plugin_objects.write_result_file()
#-------------------------------------------------------------------------------