This Python script generates a health report for a network using data from two data sources (snapshots). It uses IP Fabric's SDK to fetch data and Jinja2 and HTML to create report, which is then exported to PDF.
- Python 3.8 or higher
- Jinja2
- ipfabric
- weasyprint
- Clone this repository.
- Install the weasyprint module using pip install weasyprint.
- Set the appropriate values for server_url, token and snapshot_id variables in main.py.
- Run the script using python main.py.
- The generated report will be saved in export folder.
To use this script, you will need to provide the following parameters:
token
: Your API token for the IP Fabric serverserver_url
: The URL of the IP Fabric serversnapshot_id
: The first snapshot ID for baseline data collection
To collect data about your network, simply create an instance of the DataSource class and pass in the required parameters:
from src.data_source import DataSource
server_url = "https://<IP_FABRIC_SERVER>"
token = "<API_TOKEN>"
snapshot_id = "<SNAPSHOT_ID>"
datasource = DataSource(server_url, token, snapshot_id)
This will create an instance of the DataSource class and populate its attributes with data about the network configuration.
Enter the name of the site you want to create the report for, and the topology will be the default layout for this site.
The report contains the following sections:
- Network data summary
- Interfaces overview
- Addressing overview
- Switching overview
- Routing overview
- Wireless overview
- Topology
- Add mode data to comparee
- Add CVEs from SDK