RichitaG / N9K-CRC-Checker

MIT License
4 stars 1 forks source link

Poller scripts starts but crashes #1

Open hummela opened 1 week ago

hummela commented 1 week ago

Trying to use the script but it crashes.

Requirements succesfully installed.:

Successfully installed DateTime-4.3 bcrypt-4.1.3 cffi-1.16.0 cryptography-42.0.8 numpy-1.21.2 pandas-1.3.2 paramiko-2.7.2 pycparser-2.22 pynacl-1.5.0 python-dateutil-2.8.2 pytz-2024.1 six-1.16.0 stdiomask-0.0.5 tabulate-0.8.9 termcolor-1.1.0 zope.interface-6.4.post2

Trying to run this with Python 3.9.10.

python ./NEXUS_CRC_POLLER.py 
Enter the IP address of Switch: *******
__________________________________________________________
Enter the username: ********
___________________________________________________________
Enter the password: **********************
Trying to connect to Nexus...
Connection established to the Nexus
___________________________________________________________
Please enter the folder where files have to be stored
_____________________________________________________________
VALID folder format:
EXAMPLE:
Windows-> C:\Users\Admin\Desktop\CRC_NEXUS\
MAC -> /User/admin/Desktop/CRC_NEXUS/
---------------------------------------------------------------------------------------------------
PLEASE NOTE that data collection and script execution might get impacted if folder format is not as below
--------------------------------------------------------------------------------------------------------
Enter the absolute path of the folder where the files have to be stored:/home/******/stuff/N9K-CRC-Checker/polldata/
----------------------------------------------------------------
Enter end time of at-least 30 minutes to 1 hour after current time in order to collect interface counters at periodic interval !!!
Enter the End Time until which the script runs(in the format of yyyy-mm-dd hh:mm, current time:2024-07-02 17:17....  maximum upto 2024-07-09 17:17): 2024-07-10 10:00 
___________________________________________________________
The entered time range exceeds than max range
Do you want to continue with the maximum showed range(y/n):n
Enter the End Time until which the script runs(in the format of yyyy-mm-dd hh:mm, current time:2024-07-02 17:17....  maximum upto 2024-07-09 17:17): 2024-07-03 10:00
___________________________________________________________
Model : N9K-C9236C
Version : 9.3(10)
HostName : *********** 

Collecting data........................
Traceback (most recent call last):
  File "/home/******/stuff/N9K-CRC-Checker/./NEXUS_CRC_POLLER.py", line 365, in <module>
    store(endtimeobj)
  File "/home/******/stuff/N9K-CRC-Checker/./NEXUS_CRC_POLLER.py", line 278, in store
    crc1(outFileName,version,host_name)
  File "/home/******/stuff/N9K-CRC-Checker/./NEXUS_CRC_POLLER.py", line 111, in crc1
    interfaces[interface_counters[i][0]]["Align-Err"]=int(interface_counters[i][1])
KeyError: 'Eth1/1'

Also tried this with a more recent Python version and the latests versions of everything in the requirements file. Same result.

hummela commented 6 days ago

Since it looks like the crash has to do with some switch output, here's the output of the "show interface counters errors" command directly from the switch:

show interface counters errors

--------------------------------------------------------------------------------
Port          Align-Err    FCS-Err   Xmit-Err    Rcv-Err  UnderSize OutDiscards
--------------------------------------------------------------------------------
mgmt0                 0          0         --         --         --          --
Eth1/1                0          0          0          0          0           0
Eth1/2                0          0          0          0          0           0
Eth1/3                0          8          0          8          0           0
Eth1/4                0          0          0          0          0           0
Eth1/5                0          0          0          0          0           0
Eth1/6                0          0          0          0          0           0
Eth1/7                0          0          0          0          0           0
Eth1/8                0          0          0          0          0           0
Eth1/9                0          0          0          0          0           0
Eth1/10               0          0          0          0          0           0
Eth1/11               0          0          0          0          0           0
Eth1/12               0          0          0          0          0           0
Eth1/13               0          0          0          0          0           0
Eth1/14               0          0          0          0          0           0
Eth1/15               0          0          0          0          0           0
Eth1/16               0          0          0          0          0           0
Eth1/17               0          0          0          0          0           0
Eth1/18               0          0          0          0          0           0
Eth1/19               0          0          0          0          0           0
Eth1/20               0          0          0          0          0           0
Eth1/21               0          0          0          0          0           0
Eth1/22               0          0          0          0          0           0
Eth1/23               0          0          0          0          0           0
Eth1/24               0          0          0          0          0           0
Eth1/25               0          0          0          0          0           0
Eth1/26               0          0          0          0          0           0
Eth1/27               0          0          0          0          0           0
Eth1/28               0          0          0          0          0           0
Eth1/29               0          0          0          0          0           0
Eth1/30               0          0          0          0          0           0
Eth1/31               0          0          0          0          0           0
Eth1/32               0          0          0          0          0           0
Eth1/33               0          0          0          0          0           0
Eth1/34               0          0          0          0          0           0
Eth1/35               0          0          6          0          0           0
Eth1/36               0          0          1          0          0           0

--------------------------------------------------------------------------------
Port         Single-Col  Multi-Col   Late-Col  Exces-Col  Carri-Sen       Runts
--------------------------------------------------------------------------------
mgmt0                 0          0          0          0         --          --
Eth1/1                0          0          0          0          0           0
Eth1/2                0          0          0          0          0           0
Eth1/3                0          0          0          0          0           0
Eth1/4                0          0          0          0          0           0
Eth1/5                0          0          0          0          0           0
Eth1/6                0          0          0          0          0           0
Eth1/7                0          0          0          0          0           0
Eth1/8                0          0          0          0          0           0
Eth1/9                0          0          0          0          0           0
Eth1/10               0          0          0          0          0           0
Eth1/11               0          0          0          0          0           0
Eth1/12               0          0          0          0          0           0
Eth1/13               0          0          0          0          0           0
Eth1/14               0          0          0          0          0           0
Eth1/15               0          0          0          0          0           0
Eth1/16               0          0          0          0          0           0
Eth1/17               0          0          0          0          0           0
Eth1/18               0          0          0          0          0           0
Eth1/19               0          0          0          0          0           0
Eth1/20               0          0          0          0          0           0
Eth1/21               0          0          0          0          0           0
Eth1/22               0          0          0          0          0           0
Eth1/23               0          0          0          0          0           0
Eth1/24               0          0          0          0          0           0
Eth1/25               0          0          0          0          0           0
Eth1/26               0          0          0          0          0           0
Eth1/27               0          0          0          0          0           0
Eth1/28               0          0          0          0          0           0
Eth1/29               0          0          0          0          0           0
Eth1/30               0          0          0          0          0           0
Eth1/31               0          0          0          0          0           0
Eth1/32               0          0          0          0          0           0
Eth1/33               0          0          0          0          0           0
Eth1/34               0          0          0          0          0           0
Eth1/35               0          0          0          0          0           0
Eth1/36               0          0          0          0          0           0

--------------------------------------------------------------------------------
Port          Giants SQETest-Err Deferred-Tx IntMacTx-Er IntMacRx-Er Symbol-Err
--------------------------------------------------------------------------------
mgmt0              0           0           0           0           0          0
Eth1/1             0          --           0           0           0          0
Eth1/2             0          --           0           0           0          0
Eth1/3             0          --           0           0           0          0
Eth1/4             0          --           0           0           0          0
Eth1/5             0          --           0           0           0          0
Eth1/6             0          --           0           0           0          0
Eth1/7             0          --           0           0           0          0
Eth1/8             0          --           0           0           0          0
Eth1/9             0          --           0           0           0          0
Eth1/10            0          --           0           0           0          0
Eth1/11            0          --           0           0           0          0
Eth1/12            0          --           0           0           0          0
Eth1/13            0          --           0           0           0          0
Eth1/14            0          --           0           0           0          0
Eth1/15            0          --           0           0           0          0
Eth1/16            0          --           0           0           0          0
Eth1/17            0          --           0           0           0          0
Eth1/18            0          --           0           0           0          0
Eth1/19            0          --           0           0           0          0
Eth1/20            0          --           0           0           0          0
Eth1/21            0          --           0           0           0          0
Eth1/22            0          --           0           0           0          0
Eth1/23            0          --           0           0           0          0
Eth1/24            0          --           0           0           0          0
Eth1/25            0          --           0           0           0          0
Eth1/26            0          --           0           0           0          0
Eth1/27            0          --           0           0           0          0
Eth1/28            0          --           0           0           0          0
Eth1/29            0          --           0           0           0          0
Eth1/30            0          --           0           0           0          0
Eth1/31            0          --           0           0           0          0
Eth1/32            0          --           0           0           0          0
Eth1/33            0          --           0           0           0          0
Eth1/34            0          --           0           0           0          0
Eth1/35            0          --           0           6           0          0
Eth1/36            0          --           0           1           0          0

--------------------------------------------------------------------------------
Port         InDiscards
--------------------------------------------------------------------------------
mgmt0                --
Eth1/1                0
Eth1/2                0
Eth1/3                0
Eth1/4                0
Eth1/5                0
Eth1/6                0
Eth1/7                0
Eth1/8                0
Eth1/9                0
Eth1/10               0
Eth1/11               0
Eth1/12               0
Eth1/13               0
Eth1/14               0
Eth1/15               0
Eth1/16               0
Eth1/17               0
Eth1/18               0
Eth1/19               0
Eth1/20               0
Eth1/21               0
Eth1/22               0
Eth1/23               0
Eth1/24               0
Eth1/25               0
Eth1/26               0
Eth1/27               0
Eth1/28               0
Eth1/29               0
Eth1/30               0
Eth1/31               0
Eth1/32               0
Eth1/33               0
Eth1/34               0
Eth1/35               0
Eth1/36               0
RichitaG commented 6 days ago

Hi,

Installed all requirements in new system and ran code by following same steps as read me document. It works fine. I don't see an issue with your "show interface counters errors" outptut too.

Tip: I used pycharm terminal to run it. Not sure if it will make any difference. Please try with that.

Logs of recent run:

PLEASE NOTE that data collection and script execution might get impacted if folder format is not as below

Enter the absolute path of the folder where the files have to be stored:/Users/**/Downloads/N9K-CRC-Checker-main/

Enter end time of at-least 30 minutes to 1 hour after current time in order to collect interface counters at periodic interval !!! Enter the End Time until which the script runs(in the format of yyyy-mm-dd hh:mm, current time:2024-07-03 18:25.... maximum upto 2024-07-10 18:25): 2024-07-04 18:25


Model : N9K-C93180YC-FX3 Version : 10.2(7) HostName : ****

Collecting data........................ No errors in the Switch, do you still want to run the script(y/n):

hummela commented 6 days ago

I will try pycharm and report back later.

I am also using the ACI-CRC-FCS-Checker scripts for our ACI fabric. These scripts run fine on the same system.