def main():
config = Config()<EOL>core = HostSearch()<EOL>hosts = core.get_hosts(tags=['<STR_LIT>'], up=True)<EOL>hosts = [host for host in hosts]<EOL>host_ips = "<STR_LIT:U+002C>".join([str(host.address) for host in hosts])<EOL>url = config.get('<STR_LIT>', '<STR_LIT:host>')<EOL>access = config.get('<STR_LIT>', '<STR_LIT>')<EOL>secret = config.get('<STR_LIT>', '<STR_LIT>')<EOL>template_name = config.get('<STR_LIT>', '<STR_LIT>')<EOL>nessus = Nessus(access, secret, url, template_name)<EOL>scan_id = nessus.create_scan(host_ips)<EOL>nessus.start_scan(scan_id)<EOL>for host in hosts:<EOL><INDENT>host.add_tag('<STR_LIT>')<EOL>host.save()<EOL><DEDENT>Logger().log("<STR_LIT>", "<STR_LIT>".format(len(hosts)), {'<STR_LIT>': len(hosts)})<EOL>
This function obtains hosts from core and starts a nessus scan on these hosts.
The nessus tag is appended to the host tags.