MJL85 / natlas

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

HP ProCurve switch support #15

Open devinmcintyre opened 7 years ago

devinmcintyre commented 7 years ago

I don't seem to be having luck with this script on HP ProCurve switches. It seems that mnet isn't finding the LLDP neighbors correctly. Here's an example output:

MNet Suite v0.7
Written by Michael Laforest <mjlaforest@gmail.com>

     Config file: ./mnet.conf
       Root node: 172.16.7.11
     Output file: network.png
     Crawl depth: 10
   Diagram title: Amherst
Out Catalog file: None

+SrvRm_2920_48G (172.16.7.11)
>SrvRm_2920_48G (172.16.7.11)
-----
----- DEVICES
-----
-----------------------------------------
      Name: SrvRm_2920_48G
        IP: 172.16.7.11
  Platform: None
   IOS Ver: None
    Serial: None
   Routing: no
   OSPF ID: None
   BGP LAS: None
  HSRP Pri: None
  HSRP VIP: None
 Stack Cnt: 0
      Loopbacks:
        Not configured.
      SVIs:
        Not configured.
     Links:
Discovered devices: 1
Discovered links:   0
Created graph: network.png

For reference, here's the "show lldp info remote-device" command ran on the same switch:

LLDP Remote Devices Information

  LocalPort | ChassisId          PortId             PortDescr SysName
  --------- + ------------------ ------------------ --------- ------------------
  43        | 94 57 a5 1b ed c0  48                 48        SrvRm-2530-48G-PoE
  46        | 94 57 a5 1b 99 00  48                 48        2ndFlr-2530-48G...
  47        | 94 57 a5 1b 29 c0  48                 48        1stFlrIDF-2530-...
  48        | 94 57 a5 21 58 e0  28                 28        Elem-2530-24G-PoE

And here's an SNMP walk on the same switch.

.1.0.8802.1.1.2.1.4.1.1.5.0.43.1,OctetString,  94 57 A5 1B ED C0                                  
.1.0.8802.1.1.2.1.4.1.1.5.0.46.1,OctetString,  94 57 A5 1B 99 00                                  
.1.0.8802.1.1.2.1.4.1.1.5.0.47.1,OctetString,  94 57 A5 1B 29 C0                                  
.1.0.8802.1.1.2.1.4.1.1.5.0.48.1,OctetString,  94 57 A5 21 58 E0                                  
.1.0.8802.1.1.2.1.4.1.1.6.0.43.1,Integer,7
.1.0.8802.1.1.2.1.4.1.1.6.0.46.1,Integer,7
.1.0.8802.1.1.2.1.4.1.1.6.0.47.1,Integer,7
.1.0.8802.1.1.2.1.4.1.1.6.0.48.1,Integer,7
.1.0.8802.1.1.2.1.4.1.1.7.0.43.1,OctetString,48
.1.0.8802.1.1.2.1.4.1.1.7.0.46.1,OctetString,48
.1.0.8802.1.1.2.1.4.1.1.7.0.47.1,OctetString,48
.1.0.8802.1.1.2.1.4.1.1.7.0.48.1,OctetString,28
.1.0.8802.1.1.2.1.4.1.1.8.0.43.1,OctetString,48
.1.0.8802.1.1.2.1.4.1.1.8.0.46.1,OctetString,48
.1.0.8802.1.1.2.1.4.1.1.8.0.47.1,OctetString,48
.1.0.8802.1.1.2.1.4.1.1.8.0.48.1,OctetString,28
.1.0.8802.1.1.2.1.4.1.1.9.0.43.1,OctetString,SrvRm-2530-48G-PoE
.1.0.8802.1.1.2.1.4.1.1.9.0.46.1,OctetString,2ndFlr-2530-48G-PoE
.1.0.8802.1.1.2.1.4.1.1.9.0.47.1,OctetString,1stFlrIDF-2530-48G-PoE
.1.0.8802.1.1.2.1.4.1.1.9.0.48.1,OctetString,Elem-2530-24G-PoE
.1.0.8802.1.1.2.1.4.1.1.10.0.43.1,OctetString,HP J9772A 2530-48G-PoEP Switch, revision YA.16.02.0014, ROM YA.15.19 (/ws/swbuildm/rel_spokane_qaoff/code/build/lakes(swbuildm_rel_spokane_qaoff_rel_spokane))
.1.0.8802.1.1.2.1.4.1.1.10.0.46.1,OctetString,HP J9772A 2530-48G-PoEP Switch, revision YA.16.02.0014, ROM YA.15.19 (/ws/swbuildm/rel_spokane_qaoff/code/build/lakes(swbuildm_rel_spokane_qaoff_rel_spokane))
.1.0.8802.1.1.2.1.4.1.1.10.0.47.1,OctetString,HP J9772A 2530-48G-PoEP Switch, revision YA.16.02.0014, ROM YA.15.19 (/ws/swbuildm/rel_spokane_qaoff/code/build/lakes(swbuildm_rel_spokane_qaoff_rel_spokane))
.1.0.8802.1.1.2.1.4.1.1.10.0.48.1,OctetString,HP J9773A 2530-24G-PoEP Switch, revision YA.16.02.0014, ROM YA.15.19 (/ws/swbuildm/rel_spokane_qaoff/code/build/lakes(swbuildm_rel_spokane_qaoff_rel_spokane))
.1.0.8802.1.1.2.1.4.1.1.11.0.43.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.11.0.46.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.11.0.47.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.11.0.48.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.12.0.43.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.12.0.46.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.12.0.47.1,OctetString, 
.1.0.8802.1.1.2.1.4.1.1.12.0.48.1,OctetString, 
.1.0.8802.1.1.2.1.4.2.1.3.0.43.1.1.4.172.16.7.12,Integer,2
.1.0.8802.1.1.2.1.4.2.1.3.0.46.1.1.4.172.16.7.15,Integer,2
.1.0.8802.1.1.2.1.4.2.1.3.0.47.1.1.4.172.16.7.13,Integer,2
.1.0.8802.1.1.2.1.4.2.1.3.0.48.1.1.4.172.16.7.16,Integer,2
.1.0.8802.1.1.2.1.4.2.1.4.0.43.1.1.4.172.16.7.12,Integer,0
.1.0.8802.1.1.2.1.4.2.1.4.0.46.1.1.4.172.16.7.15,Integer,0
.1.0.8802.1.1.2.1.4.2.1.4.0.47.1.1.4.172.16.7.13,Integer,0
.1.0.8802.1.1.2.1.4.2.1.4.0.48.1.1.4.172.16.7.16,Integer,0
.1.0.8802.1.1.2.1.4.2.1.5.0.43.1.1.4.172.16.7.12,OID,0.0
.1.0.8802.1.1.2.1.4.2.1.5.0.46.1.1.4.172.16.7.15,OID,0.0
.1.0.8802.1.1.2.1.4.2.1.5.0.47.1.1.4.172.16.7.13,OID,0.0
.1.0.8802.1.1.2.1.4.2.1.5.0.48.1.1.4.172.16.7.16,OID,0.0

And just OIDs that apply to "Elem-HP2530-24G-PoE"

.1.0.8802.1.1.2.1.4.1.1.5.0.48.1,OctetString,  94 57 A5 21 58 E0 
.1.0.8802.1.1.2.1.4.1.1.9.0.48.1,OctetString,Elem-2530-24G-PoE
.1.0.8802.1.1.2.1.4.1.1.10.0.48.1,OctetString,HP J9773A 2530-24G-PoEP Switch, revision YA.16.02.0014, ROM YA.15.19 (/ws/swbuildm/rel_spokane_qaoff/code/build/lakes(swbuildm_rel_spokane_qaoff_rel_spokane))
.1.0.8802.1.1.2.1.4.2.1.3.0.48.1.1.4.172.16.7.16,Integer,2
.1.0.8802.1.1.2.1.4.2.1.4.0.48.1.1.4.172.16.7.16,Integer,0
.1.0.8802.1.1.2.1.4.2.1.5.0.48.1.1.4.172.16.7.16,OID,0.0
slashrjl commented 7 years ago

in node.py the code is looking for .1.0.8802.1.1.2.1.4.1.1.4.0 [or with my pull .1.0.8802.1.1.2.1.4.1.1.4] to determine the row index that it will use to match up the rest of the data. Your snmpwalk does not include that MIB variable -- what do you get from snmpbulkwalk -On -v2c -c public 172.16.7.11 .1.0.8802.1.1.2.1.4.1.1.4 if you getNoSuchError or 'No Such Instance currently exists at this OID' then try changing the first occurrence of OID_LLDP_TYPE to OID_LLDP_DEVID in node.py: (around line 620 as of 0.8.2)

Hope this helps

/RjL