tc45 / GetInventory

Batch Network Device Detail Collector (Cisco)
MIT License
23 stars 9 forks source link

interface collection for IOS works but not Nexus #16

Open mallenso opened 2 years ago

mallenso commented 2 years ago

Errors on Nexus 9K 1 | NNN.NNN.NNN.NNN | Exception Type: <class 'TypeError'> | At Function: show_proc_cpu | Line No: 698 | Error Message: string indices must be integers Traceback (most recent call last): File "c:\GetInventory\GetInventory-master\main.py", line 698, in show_proc_cpu net_dev.cpu_5_sec = output[0]['cpu_5_sec'] TypeError: string indices must be integers

2 | NNN.NNN.NNN.NNN | Exception Type: <class 'textfsm.parser.TextFSMTemplateError'> | At Function: con_thread | Line No: 580 | Error Message: Value 'INTERFACES (\S+)' must be contained within a '()' pair. Line 1. Traceback (most recent call last): File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 726, in _ParseFSMVariables value.Parse(line) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 320, in Parse raise TextFSMTemplateError( textfsm.parser.TextFSMTemplateError: Value 'INTERFACES (\S+)' must be contained within a '()' pair.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\GetInventory\GetInventory-master\main.py", line 580, in con_thread gather_interface(conn, net_dev, n) File "c:\GetInventory\GetInventory-master\main.py", line 176, in gather_interface vrf_info = get_vrf_interfaces_dict(net_dev, connection, count) File "c:\GetInventory\GetInventory-master\main.py", line 1015, in get_vrf_interfaces_dict output = log_cmd_textfsm(conn, device, command, count) File "c:\GetInventory\GetInventory-master\main.py", line 680, in log_cmd_textfsm output = connection.send_command(command, use_textfsm=True, textfsm_template=txtfsm_tmpl) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\base_connection.py", line 1420, in send_command structured_output = get_structured_data( File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\utilities.py", line 279, in get_structured_data return _textfsm_parse(textfsm_obj, raw_output, attrs) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\utilities.py", line 251, in _textfsm_parse textfsm_obj.ParseCmd(raw_output, attrs) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko_textfsm_clitable.py", line 272, in ParseCmd self.table = self._ParseCmdItem(self.raw, template_file=template_files[0]) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko_textfsm_clitable.py", line 294, in _ParseCmdItem fsm = textfsm.TextFSM(template_file) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 586, in init self._Parse(template) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 684, in _Parse self._ParseFSMVariables(template) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 728, in _ParseFSMVariables raise TextFSMTemplateError('%s Line %s.' % (error, self._line_num)) textfsm.parser.TextFSMTemplateError: Value 'INTERFACES (\S+)' must be contained within a '()' pair. Line 1.

Also seeing errors on Nexus 5K pair 5K1 1 | NNN.NNN.NNN.NNN | Exception Type: <class 'textfsm.parser.TextFSMError'> | At Function: con_thread | Line No: 580 | Error Message: State Error raised. Rule Line: 14. Input Line: Eth1/14 -- xcvrInval 1 full 10G Fabric Exte Traceback (most recent call last): File "c:\GetInventory\GetInventory-master\main.py", line 580, in con_thread gather_interface(conn, net_dev, n) File "c:\GetInventory\GetInventory-master\main.py", line 174, in gather_interface log_cmd_textfsm(connection, net_dev, command2, count) File "c:\GetInventory\GetInventory-master\main.py", line 680, in log_cmd_textfsm output = connection.send_command(command, use_textfsm=True, textfsm_template=txtfsm_tmpl) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\base_connection.py", line 1420, in send_command structured_output = get_structured_data( File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\utilities.py", line 279, in get_structured_data return _textfsm_parse(textfsm_obj, raw_output, attrs) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\utilities.py", line 251, in _textfsm_parse textfsm_obj.ParseCmd(raw_output, attrs) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko_textfsm_clitable.py", line 272, in ParseCmd self.table = self._ParseCmdItem(self.raw, template_file=template_files[0]) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko_textfsm_clitable.py", line 303, in _ParseCmdItem for record in fsm.ParseText(cmd_input): File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 897, in ParseText self._CheckLine(line) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 946, in _CheckLine if self._Operations(rule, line): File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 1026, in _Operations raise TextFSMError('State Error raised. Rule Line: %s. Input Line: %s' textfsm.parser.TextFSMError: State Error raised. Rule Line: 14. Input Line: Eth1/14 -- xcvrInval 1 full 10G Fabric Exte

Nexus 5K2 1 | NNN.NNN.NNN.NNN | Exception Type: <class 'textfsm.parser.TextFSMTemplateError'> | At Function: con_thread | Line No: 580 | Error Message: Value 'INTERFACES (\S+)' must be contained within a '()' pair. Line 1. Traceback (most recent call last): File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 726, in _ParseFSMVariables value.Parse(line) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 320, in Parse raise TextFSMTemplateError( textfsm.parser.TextFSMTemplateError: Value 'INTERFACES (\S+)' must be contained within a '()' pair.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "c:\GetInventory\GetInventory-master\main.py", line 580, in con_thread gather_interface(conn, net_dev, n) File "c:\GetInventory\GetInventory-master\main.py", line 176, in gather_interface vrf_info = get_vrf_interfaces_dict(net_dev, connection, count) File "c:\GetInventory\GetInventory-master\main.py", line 1015, in get_vrf_interfaces_dict output = log_cmd_textfsm(conn, device, command, count) File "c:\GetInventory\GetInventory-master\main.py", line 680, in log_cmd_textfsm output = connection.send_command(command, use_textfsm=True, textfsm_template=txtfsm_tmpl) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\base_connection.py", line 1420, in send_command structured_output = get_structured_data( File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\utilities.py", line 279, in get_structured_data return _textfsm_parse(textfsm_obj, raw_output, attrs) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko\utilities.py", line 251, in _textfsm_parse textfsm_obj.ParseCmd(raw_output, attrs) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko_textfsm_clitable.py", line 272, in ParseCmd self.table = self._ParseCmdItem(self.raw, template_file=template_files[0]) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\netmiko_textfsm_clitable.py", line 294, in _ParseCmdItem fsm = textfsm.TextFSM(template_file) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 586, in init self._Parse(template) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 684, in _Parse self._ParseFSMVariables(template) File "C:\Users\user1\AppData\Local\Programs\Python\Python310\lib\site-packages\textfsm\parser.py", line 728, in _ParseFSMVariables raise TextFSMTemplateError('%s Line %s.' % (error, self._line_num)) textfsm.parser.TextFSMTemplateError: Value 'INTERFACES (\S+)' must be contained within a '()' pair. Line 1.