This project is a tool for verifying network device configurations by comparing database records with SQL query results and real-time SNMP data. The errors are printed to stdout and can be sent as an email if necessary. Moreover, a number of files are created for matching to avoid having to use long loops, which are stored in the tmp folder. My recommendation is to use crontab for scheduling.
Features
- Database Querying: Device information fetching from the database using SQL queries. For patch pannels a query is performed iteratively until we reach a final end switch. Bear in mind that this part may vary for different database designs.
- SNMP Commands Execution: SNMP commands on specified devices to gather real-time data using the ifDescr, ifOperStatus and ifAlias values.
- Data Matching and Analysis: Compares database entries with SNMP command results to identify mismatches.
- Email Notification: Prepares and sends an email report detailing any discrepancies found.
Prerequisites
- Python 3
- MySQL Connector (mysql-connector-python)
- SNMP tools (snmpwalk)
- SMTP server for sending emails
Update the user, password, and database parameters in the getDataOpenDCIM function as well as the From and To addresses in sendEmail, and to run the script do python3 main.py in CLI.