Skip to content

Script will collect CRC error from Cisco Device. Output will be generated on screen in table format and stored in a CSV file.

License

Notifications You must be signed in to change notification settings

bsingh23/nornir_crc_errors

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

published Run in Cisco Cloud IDE Python3.6

Nornir Script: Find Interfaces with CRC Errors

This Nornir script collects CRC errors from Cisco network devices and writes the data to a CSV file and provide output on screen using RICH table.

Script will prompt the user to enter the minimum number of CRC errors.

The RICH table and CSV file contains the hostname, interface, and the number of CRC errors for each interface.

Requirements

  • Python 3.9+
  • Nornir 3.x
  • Nornir-scrapli plugin
  • Nornir-utils plugin
  • Scrapli library
  • Genie library
  • Devices configured for SSH access

Note: Code tested on Python 3.9.6

Configuration

Configure your network devices in the hosts.yaml file using the following format:

host_name:
    hostname: ip_address
    platform: ios
    username: username
    password: password
    groups: (Optional)
        - <group_name>

You can also specify SSH port and any other connection options in the inventory file. Refer to the Nornir documentation for more information.

Usage

  1. Clone the repository:

    git clone https://github.com/bsingh23/nornir_crc_errors.git
  2. Install the dependencies:

    pip3 install -r requirements.txt
  3. Modify the config_test.yaml file in the nornir directory with your specific settings.

  4. Run the script:

    python3 crc_error_v1.0.py
  5. The script will create a CSV file in the same directory as the script with the following name format: crcerror_<current_datetime>.csv.

Sample Output

Hostname Interface CRC Error
switch1 GigabitEthernet1/0/1 1214
switch2 GigabitEthernet0/0/1 57
switch3 GigabitEthernet2/0 150

Notes

  • The script uses the Genie library to parse the output of the show interfaces command. Make sure your network devices support the show interfaces command output in a format that can be parsed by Genie.

  • Testing done on IOS and IOS-XE

About

Script will collect CRC error from Cisco Device. Output will be generated on screen in table format and stored in a CSV file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages