3 round results to print out the execution time of calling the functions This is a comparison in execution time by sending show version to three Cisco ASA - fw01, fw02 and fw03. All connections with netmiko.ConnectHandler has a global_delay_factor of 0.5s. I have made three functions: connect_device_type_1: This function does not use threading but … Continue reading [python]Comparing execution time without threading, with threadpoolexecutor and threading subclass
Tag: multithreading
[python]Capture return values after threads are finished.
Return value lost after threads finished I have made two functions: The jinja template for preparing the object network {name} command: Then I create a test code to push multiple object network {name} commands to a single cisco asa - fw02. To achieve concurrency I use the threading.Thread module, however my return value of send_net_objs_to_asa_host … Continue reading [python]Capture return values after threads are finished.
[python]Download multiple files from different directories from ftp server
File patterns This is to download multiple files of the same pattern form different directory. In ftp.pyclass.com there are directories organized in year, and within each year there are gunzip files that has this pattern stationId-Year on this example I will be downloading the gunzip files which has a station id 010010-99999, between the year … Continue reading [python]Download multiple files from different directories from ftp server
[python]Download files with FTP client with multithreading
You may wish to enroll the course by Ardit Sulce, I will not reveal the username and password on his ftp.pyclass.com, to be fair to him in order to use his resource for practice and learning data science you got to enroll to his course. The code presented here has 5 parts: security.crypto, for encrypting … Continue reading [python]Download files with FTP client with multithreading
[python]Multiprocess and multithreading for port scan version 3
Background This is an upgrade scripts to check for open ports on every addresses found in subnets. The upgrade uses Processpoolexecutor, a minor re-write uses the processpoolexecutor and theadpoolexecutor together. network_discovery.py - obtains directly connected subnets scanner.py This script does the port scanning based on the subnets obtained from network_discovery.py. start_now.py - main script to … Continue reading [python]Multiprocess and multithreading for port scan version 3
[python]Multithreading to scan for port status version 2
Background this is a follow up of this post, on that previous post, threading printed the results however i had problems with getting the returned value from the function which the thread was running, lama4ok suggested in his comment to use concurrent.futures, well his suggestion does work, so now I can get the actual returned … Continue reading [python]Multithreading to scan for port status version 2
[python]Multithreading to scan for port status
Background I have noticed that previously my script is a one to one, meaning the scripts I wrote do specific things to a single target, this will be very impractical if the targets are more than one and requires to do the same function. Hence I am exploring into threading. Threading My first use of … Continue reading [python]Multithreading to scan for port status