++scan stuff

This commit is contained in:
Nico Schottelius 2020-12-11 19:37:53 +01:00
commit bc2948a8a5
2 changed files with 24 additions and 1 deletions

View file

@ -56,6 +56,8 @@ from scapy.all import *
# Datetime overwrites scapy.all.datetime - needs to be imported AFTER
import datetime
import cdist.config
log = logging.getLogger("scan")
class Trigger(object):
@ -120,6 +122,19 @@ class Scanner(object):
with open(fname, "w") as fd:
fd.write(f"{now}\n")
def config(self):
"""
Configure a host
- Assume we are only called if necessary
- However we need to ensure to not run in parallel
- Maybe keep dict storing per host processes
- Save the result
- Save the output -> probably aligned to config mode
"""
def start(self):
self.process = Process(target=self.scan)
self.process.start()