This is a Python application that utilizes the Cisco DNA Center API to report issues related to network devices managed by Cisco DNA Center. The application can be configured to run on a regular basis using crontab and can send notifications via Webex or SMS using eCall REST API.
To use this application, you will need the following:
- Python 3.x
- Cisco DNA Center > 2.3.3.x
- Webex account (optional)
- eCall REST API account (optional)
-
Clone this repository to your local machine using the following command:
git clone https://github.com/pamosima/dnac_issue_report.git
-
Navigate to the repository directory:
cd dnac_issue_report
-
Create a Python virtual environment:
python -m venv venv source venv/bin/activate
-
Install the required Python packages:
pip install -r requirements.txt
-
Create an environment file:
cp .env.sample .env
-
Open
.env
and update the following parameters:# Cisco DNA Center dnacIP = "Cisco DNA Center URL" # dnacIP = "https://<fqdn or ip>:443" dnacUsername = "Cisco DNA Center username" dnacPassword = "Cisco DNA Center password" # Optional: Webex Notifications webexToken = "Webex Teams access token" webexRoomId = "Webex Teams roomId" # Optional: eCall Notifications ecallUsername = "eCall username" ecallPassword = "eCall password"
Note: If using Notification, please provide corresponding optional information.
To run the application, simply execute the following command:
python dnac_issue_report_print.py
The application will retrieve a list of open issues and print the information to the console.
python dnac_issue_report_webex.py
The application will retrieve a list of open issues and send notifications via Webex.
python dnac_issue_report_webex.py
The application will retrieve a list of open issues and send notifications via SMS.
By default, the application will run once and exit. To run the application on a regular basis, you can use crontab. For example, to run the application every hour, you can add the following line to your crontab:
0 * * * * ~/code/dnac_issue_report/venv/bin/python ~/code/dnac_issue_report/dnac_issue_report_webex.py
Cisco DNA Center Issue Report
Occurrence: 25.04.2023 15:52:50
---
No of Issues: P1=0 P2=6 P3=1 P4=0
---
List of P1 & P2 Issues:
P2: The RADIUS server '192.168.99.14:1812,1813' is not responding to requests being made from the network device 'C9200-24P-1'
P2: The RADIUS server '192.168.99.13:1812,1813' is not responding to requests being made from the network device 'C9200-24P-2'
P2: The RADIUS server '192.168.99.14:1812,1813' is not responding to requests being made from the network device 'wlsn-border-1'
P2: The RADIUS server '192.168.99.13:1812,1813' is not responding to requests being made from the network device 'C9300-24T-1'
---
If you would like to contribute to this project, please fork the repository and submit a pull request.
People responsible for the creation and maintenance of this project:
- Patrick Mosimann pamosima@cisco.com
If you would like to contribute to this project, please fork the repository and submit a pull request.
This project is licensed to you under the terms of the Cisco Sample Code License.
Please post any issues or comments directly on GitHub.