Currently I am working on a project to collect port traffic data from a few network devices. These are the interesting areas of that project
- .env file to store credentials.
- Read port data from a csv file and store in a list.
- SSH to the devices and collect traffic data from devices using
netmiko
library in Python. - Resolving errors that occur during traffic collection.
- Usage of
else
in exception handling. - Implement a retry mechanism to run when traffic fetching fails.
- Extract the data from
netmiko
result using regular expressions and store in Python data structures. Used regex capture groups for extracting the required data. - Convert traffic utilisation to traffic rate by using port type.
- Calculate total traffic of ports.
- Write results to csv files.
- import a function from a parent directory.
- In version 2.0 rewrote the project to use Python classes.
- Writing utility functions in a file named
util.py
Functionalities that planned to be implemented
- add tabulate for printing output on commandline
- add option parsing using argparser.
- database implementation
- cache implementation
- charting