help='Bootstrapping the system',
)
+parser.add_argument(
+ '--trigger',
+ help='Trigger one single VES event from each simulator',
+)
+
parser.add_argument(
'--ipves',
help='IP of the VES collector',
)
+parser.add_argument(
+ '--ipfileserver',
+ help='Visible IP of the file server (SFTP/FTPS) to be included in the VES event',
+)
+
parser.add_argument(
'--ipstart',
help='IP address range beginning',
if args.bootstrap and args.ipstart and args.ipves:
print("Bootstrap:")
+ start_port=2000
+
for i in range(int(args.bootstrap)):
print("PNF simulator instance: " + str(i) + ".")
IpPnfSim = ipaddress.ip_address(args.ipstart) + int(2 + (i * 16))
print("\tIp Pnf SIM:" + str(IpPnfSim))
+ IpFileServer = args.ipfileserver
+
+
+ PortSftp=start_port +1
+ PortFtps=start_port +2
+ start_port +=2
IpFtps = ipaddress.ip_address(args.ipstart) + int(3 + (i * 16))
print("\tIp Ftps: " + str(IpFtps))
-
+
IpSftp = ipaddress.ip_address(args.ipstart) + int(4 + (i * 16))
print("\tIp Sftp:" + str(IpSftp))
str(i) + " " +\
str(args.ipves) + " " +\
str(IpPnfSim) + " " +\
+ str(IpFileServer) + " " +\
+ str(PortSftp) + " " +\
+ str(PortFtps) + " " +\
str(IpFtps) + " " +\
str(IpSftp)
shell=True)
print('Stopping:', completed.stdout)
+
+if args.trigger:
+ print("Triggering VES sending:")
+
+ for i in range(int(args.trigger)):
+ foldername = "pnf-sim-lw-" + str(i)
+
+ completed = subprocess.run(
+ 'cd ' +
+ foldername +
+ "; ./simulator.sh trigger-simulator",
+ shell=True)
+ print('Status:', completed.stdout)
+
else:
print("No instruction was defined")
sys.exit()