Introduction

  • The code is designed to work on Nexus Switches Family platforms that support Python Platform 2.7 or greater.
  • It uses the smtplib module for sending email alerts and Cisco CLI module for interacting with Cisco Nexus switches.
  • smtplib- https://docs.python.org/3/library/smtplib.html

Need for the Code

  • The code is useful for monitoring parameters like CRF, INPUT ERROR, OUTPUT ERROR, GIANTS, COLLISION, etc., of network interfaces.
  • It provides proactive monitoring of physical interface parameters at the Level 1 Physical layer.

How to Use the Code on Nexus Switches

  1. Upload the file named monitor-interface.py to the flash file of the Nexus switch.
  2. Execute the script within privilege mode using either python monitor-interface.py or python3 monitor-interface.py.
  3. The script will send email alerts if it detects any changes in the interface parameter values.

Applying Scheduling Configuration on Nexus Switches

Wrapping Up

  1. The code is ready to be executed on Nexus switches.
  2. Scheduling configuration is applied to run the code at specific intervals (e.g., every 10 minutes).
  3. The code will send email alerts if it detects changes in interface parameter values.

This script can be a valuable tool for monitoring network interfaces on Cisco Nexus switches and receiving timely alerts when issues occur.

View code on GitHub
  • Owner

  • Contributors

    +2Github contributors
  • Categories

  • Programming Languages

    Python
  • License

    MIT License

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.