MJL85 / natlas

natlas - Network Discovery and Auto-Diagramming
GNU General Public License v2.0
526 stars 114 forks source link

List index out of range #56

Open wraza2k9 opened 5 years ago

wraza2k9 commented 5 years ago

While collecting node Details. It gives the error:
"vlan = n.split('.')[14] IndexError: list index out of range

cbarbudo commented 5 years ago

Same problem. In my case, It appears while Collecting Node Details, but when found previously an "UNKNOWN" node name on discovery stage. Seems it happens in cases get_system_name returns UNKNOWN, AND sefl.snmpobj.getval(OID_SYSNAME) equals 'None'.

techn0mad commented 5 years ago

I've run into this when trying to parse Meraki nodes; I ran into errors at OID 1.3.6.1.4.1.9.9.128.1.1.1.1.3 (CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB). It seems to be related to MIB issues since I can re-create the error with net-snmp:

$ snmpwalk -v 2c -c N0conn3ct 192.168.10.24 1.3.6.1.4.1.9.9.128
SNMPv2-SMI::enterprises.9.9.128 = No more variables left in this MIB View (It is past the end of the MIB tree)

I wonder if additional MIB need to be included in some cases?

B3DTech commented 4 years ago

Same here:

[158/174]+ Colden Conference Room (10.85.151.88)Traceback (most recent call last):
  File "./natlas-cli.py", line 305, in <module>
    main(sys.argv[1:])
  File "./natlas-cli.py", line 96, in main
    exec_mod(mod, argv[1:])
  File "./natlas-cli.py", line 167, in exec_mod
    modret = module.entryfunc(natlas_obj, argv)
  File "./modules/diagram.py", line 85, in mod_entry
    natlas_obj.discover_network(opt_root_ip, 1)
  File "/root/natlas/natlas/natlas/natlas.py", line 104, in discover_network
    self.network.discover_details()
  File "/root/natlas/natlas/natlas/network.py", line 175, in discover_details
    n.query_node()
  File "/root/natlas/natlas/natlas/node.py", line 313, in query_node
    vlan = n.split('.')[14]
IndexError: list index out of range

But this is happening to me on A) a leaf device that it's not supposed to get the downstream devices from, and B) a subnet that I have a deny on 10.85.150.0/23.

marcolussetti commented 4 years ago

Has anyone found a workaround for this beyond excluding the device?