Skip to content

Commit 99bf3e5

Browse files
committed
made number of subprocesses configurable via config file. Just add subprocs:number to the probe.conf file
1 parent 336d0e2 commit 99bf3e5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

probe.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ def main():
113113
time.sleep(int(config['baseinterval']) / 2)
114114
gc.collect()
115115
if str(json_response) != '[]':
116-
json_response_chunks = [json_response[i:i + 10] for i in range(0, len(json_response), 10)]
116+
if config['subprocs']:
117+
json_response_chunks = [json_response[i:i + int(config['subprocs'])]
118+
for i in range(0, len(json_response), int(config['subprocs']))]
119+
else:
120+
json_response_chunks = [json_response[i:i + 10]
121+
for i in range(0, len(json_response), 10)]
117122
for element in json_response_chunks:
118123
for part in element:
119124
if config['debug']:

probe_installer.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def init_script(script_path, user):
126126
raw_input("Please provide the path the probe files are located: ")).rstrip().lstrip()
127127
probe_cleanmem = "%s" % str(
128128
raw_input("Do you want the mini probe flushing buffered and cached memory [y/N]: ")).rstrip().lstrip()
129+
probe_conf['subprocs'] = "%s" % str(
130+
raw_input("How much subprocesses should be spawned for scanning [10]: ")).rstrip().lstrip()
129131
probe_conf['announced'] = "0"
130132
probe_conf['protocol'] = "1"
131133
probe_conf['debug'] = ""
@@ -142,6 +144,8 @@ def init_script(script_path, user):
142144
probe_conf['port'] = "443"
143145
if not probe_conf['baseinterval']:
144146
probe_conf['baseinterval'] = "443"
147+
if not probe_conf['subprocs']:
148+
probe_conf['subprocs'] = "10"
145149
if not (probe_conf['gid'] or probe_conf['server']):
146150
print "No values for GID or CORE SERVER given. Script will now exit"
147151
sys.exit()

0 commit comments

Comments
 (0)