Git Product home page Git Product logo

natlas's People

Contributors

fabaff avatar jasonbarbee avatar miqueet avatar mjl85 avatar nuno-andre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

natlas's Issues

Enhancement Request: Inject Node to diagram

I'm looking for a way to inject a node that is not able to be discovered (non CDP/LLDP). Or add to discovery across a link that is not CDP/LLDP Discoverable. I have a wireless bridge in my network and would like to discover both sides.

failed to detect valid IP address

Getting this on a graph walk using current master (0.8.2; 3ed921f).

Traceback (most recent call last):
  File "/usr/bin/mnet.py", line 5, in <module>
    pkg_resources.run_script('mnet==0.8.2', 'mnet.py')
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 528, in run_script
  File "build/bdist.linux-x86_64/egg/pkg_resources.py", line 1401, in run_script
  File "/usr/lib/python2.6/site-packages/mnet-0.8.2-py2.6.egg/EGG-INFO/scripts/mnet.py", line 198, in <module>

  File "/usr/lib/python2.6/site-packages/mnet-0.8.2-py2.6.egg/EGG-INFO/scripts/mnet.py", line 67, in main

  File "/usr/lib/python2.6/site-packages/mnet-0.8.2-py2.6.egg/EGG-INFO/scripts/mnet.py", line 129, in graph

  File "build/bdist.linux-x86_64/egg/mnetsuite/graph.py", line 84, in crawl
  File "build/bdist.linux-x86_64/egg/mnetsuite/graph.py", line 246, in _crawl_node
  File "build/bdist.linux-x86_64/egg/mnetsuite/graph.py", line 246, in _crawl_node
  File "build/bdist.linux-x86_64/egg/mnetsuite/graph.py", line 223, in _crawl_node
  File "build/bdist.linux-x86_64/egg/mnetsuite/graph.py", line 258, in is_node_allowed
  File "/usr/lib/python2.6/site-packages/netaddr-0.7.19-py2.6.egg/netaddr/ip/__init__.py", line 306, in __init__
    'address from %r' % addr)
netaddr.core.AddrFormatError: failed to detect a valid IP address from '136.29.252.207.20.86'

I don't know which node would be reporting that, but I'm assuming some kit somewhere is reporting a bad IP in CDP adjacency. We have some IBM kit in there somewhere, and I would be shocked if they report anything worthwhile/valid, so possible that's the issue.

I'm assuming this would be a try/except to grab this in graph.py?

Duplicated connections in diagram

Hi,

I consistently have duplicated connections in my diagram. I did try to have a look but I'm not a programmer so wasn't able to fix it. This happens every time so its easily reproduced.

Regards

duplicated

Enhancement request: Higher resolution output

I understand that there may be limitations to what the Python modules for the image generation can handle but I'd still like to request that .PNG files have a higher resolution. Devices and connections can be barely legible when zoomed in.

It appears that the output image has a resolution of 96ppi. Could this be raised or have the option of a .SVG file for output? SVG would be lightweight and can be scaled without losing quality.

. depth ! connection error

natlas# py3 ./natlas-cli.py diagram -r 172.16.10.4 -c  cfg.json -o allGs.svg -t 'xxx'
natlas v0.12
Michael Laforest <[email protected]>
Python 3.6.6

     Config file: cfg.json
     Output file: allGs.svg
Out Catalog file: None
       Root node: 172.16.10.4
  Discover depth: 100
   Diagram title: yinhai

Discovery codes:
    . depth             ! connection error
    + discovering node  > numerating adjacencies
    i include node      L leaf node

Discovering network...
1  [root]  +UNKNOWN (172.16.10.4)

Collecting node details...
[1/1]! UNKNOWN (172.16.10.4) 0.00 sec

Back filling node details...
Created diagram: allGs.svg

Completed in 0:0:12.40s

List index out of range

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

Dosn´t run on Linux and Mac

Hi,

i have tried to run natlas on Mac and on Linux, in both cases natlas-cli.py chrashes with this error:

Traceback (most recent call last):
  File "./natlas-cli.py", line 35, in <module>
    import natlas
  File "/vagrant/natlas/__init__.py", line 2, in <module>
    from .natlas import natlas
  File "/vagrant/natlas/natlas.py", line 35, in <module>
    from .network import natlas_network
  File "/vagrant/natlas/network.py", line 29, in <module>
    from .util import *
  File "/vagrant/natlas/util.py", line 34, in <module>
    from .snmp import *
  File "/vagrant/natlas/snmp.py", line 27, in <module>
    from pysnmp.entity.rfc3413.oneliner.cmdgen import cmdgen
ImportError: No module named pysnmp.entity.rfc3413.oneliner.cmdgen

feature request: change behavior for "get-hosts" in discovery mode

Using the get-hosts module in discovery mode, using -r "ip" of a router or firewall (likely the default gateway) that does know anything about cdp or lldp neighbors is less or more useless. Discovery stops after 1 node. This is by design.

Of course -r could start at the first switch ip in the tree and ignore the router/firewall ip, but then using the arp discovery on these switches does not bring much useful information either. This is by design also, since the switch does not necessarily talk to devices, especially in VLANs where a switch does not have a management IP. Moreover -n has to be used on all switches that one must know from discovery mode.

Wouldn´t it be nice to have the behavior of the get-hosts single node module (using -n "ip" together with -r "ip" ) in the get-hosts module working in discovery mode by adding something like an "arp helper" ?

Example:

natlas-cli get-hosts -r "first switch ip in tree" --arp-helper "firewall/router ip" -c file -d depth

Enhancement Request: SNMPv3

I'm no expert on SNMPv3 by any means but is there any particular reasoning behind this project only supporting v2/v2c? Thanks,

Griffin

Discovery issue: get_bulk not working correctly

I put comments in the get_bulk() function in snmp.py. It's not walking the sub-section of the MIB correctly (e.g. 1 vs. several rows of CDP data). From some debug printing, all the get_bulk calls return exactly 1 item, the first one.

I narrowed this down just now: the issue is the prettyPrint().startswith is returning False every time, so the for loop executes exactly once. When I comment that out in snmp.py, the same problem arises in node.py. So tracking down / fixing startswith calls seems to be the issue.

Printing strings shows that prettyPrint is converting the OID to use names:
PRETTYPRINT: < SNMPv2-SMI::enterprises.9.9.23.1.2.1.1.24.3.4 >
OID for startswith: < 1.3.6.1.4.1.9.9.23.1.2.1.1 >

Adding "lookupMIB=False" to the tail end of the cmdGen.bulkCmd call fixes that. (Change in the flag's name or ???)

Context: I'm using pysnmp 4.4.2 on Ubuntu. Tried other versions of pysnmp, no joy. Using Python 2.7.

Stuck at getting IOS version

Have just installed mnet, but it is stuck when executing the following command (made sure I set depth at 1 to ensure it doesn't graph my whole network).

mnet.py graph -r 172.21.121.1 -f test.png -d 1 -c mnet.conf

However, it seems to stop during the following SNMP request:

09:30:36.413112 IP CENSOREDHOST.snmp >MYHOST.59886: C=XXXXXXXX GetResponse(214) 47.1.1.1.1.10.1001="12.2(40)SE" 47.1.1.1.1.10.1002="" 47.1.1.1.1.10.1003="" 47.1.1.1.1.10.1004="" 47.1.1.1.1.10.1005="" 47.1.1.1.1.10.1006="" 47.1.1.1.1.10.1007="" 47.1.1.1.1.10.1008="" 47.1.1.1.1.10.1009="" 47.1.1.1.1.10.1010=""

Conf looks like this (minimal):

{
        "snmp" : [
                { "community":"XXXXXXXX",     "ver":2 }
        ],
        "domains" : [
        ],
        "exclude" : [
        ],
        "subnets" : [
        ],
        "graph" : {
                "node_text_size" : 10,
                "link_text_size" : 9,
                "title_text_size" : 15,
                "include_svi" : 0,
                "include_lo" : 0,
                "include_serials" : 0,
                "get_stack_members" : 0,
                "get_vss_members" : 0,
                "expand_stackwise" : 0,
                "expand_vss" : 0,
                "expand_lag" : 0
        }
}

Would it be possible to implement some kind of timeout?

Expanding and Collapsing for Port Channels

I recently install new cisco 9500 and 9300 switches and natlas will now always leave port channels expanded even though the config file has a 0 for expand port channels.

tracemac always NOT FOUND

python3 natlas-cli.py tracemac -n 10.40.10.1 -m ffff.c538.3203
natlas v0.12.1
Michael Laforest <[email protected]>
Python 3.6.7

HOP    NODE IP          NODE NAME                  VLAN     PORT          REMOTE NODE IP   REMOTE NODE NAME
---    -------          ---------                  ----     ----          --------------   ----------------
1      10.40.10.1
NOT FOUND

If I run show mac-address | include ffff.c538.3203 on the switch, it is there
ffff.c538.3203 1/1/29 Dynamic 104
Not really sure where to start looking. ANy help would be appreciated.

tracemac through port-channel

Hello,

Perhaps it is normal behavior but when i use tracemac it doesn't go deeper than a port channel.

myuser@mylinuxcomputer:~/natlas$ python3.8 natlas-cli.py tracemac -n XXXXX.domain.com -m 0XXX.8XXc.0XXa
natlas v0.12.1
Michael Laforest <[email protected]>
Python 3.8.2

HOP    NODE IP          NODE NAME                  VLAN     PORT          REMOTE NODE IP   REMOTE NODE NAME
---    -------          ---------                  ----     ----          --------------   ----------------
1      XXXXX.domain.com  XXXXX.domain.com  1        port-channel20

FOUND

MAC Address: 0XXX.8XXc.0XXa
    Node IP: XXXXX.domain.com
  Node Name: XXXXX.domain.com
       Port: port-channel20

If it is not by design, what could be the reason ?

PS : Thanks for your amazing tool !

Regards,

LLDP discovery fix

I was playing around with this on my home network and found the LLDP discovery was failing.
the code assumed that the lldpRemTimeMark would be zero, which it may be in cisco switches, but isn't in some other vendor's devices.

Here's the index definition for reference.
[Pull request submitted with fix in -- hope I got it right.]

/RjL

lldpRemEntry OBJECT-TYPE
    SYNTAX      LldpRemEntry
    MAX-ACCESS  not-accessible
    STATUS      current
    DESCRIPTION
            "Information about a particular physical network connection.
            Entries may be created and deleted in this table by the agent,
            if a physical topology discovery process is active."
    INDEX   {
           lldpRemTimeMark,
           lldpRemLocalPortNum,
           lldpRemIndex
    }
    ::= { lldpRemTable 1 }

./setup.py: line 20: import: command not found

Hi Team,

I am getting below error

[jessica@lab natlas-master]$ ./setup.py
./setup.py: line 1: license: command not found
./setup.py: line 17: from: command not found
./setup.py: line 18: import: command not found
./setup.py: line 20: import: command not found
./setup.py: line 21: syntax error near unexpected token (' ./setup.py: line 21: _version = imp.load_source('', 'natlas/_version.py')'

Use /usr/bin/env python instead of /usr/bin/python in the shebang

Hi,

If you use /usr/bin/env python instead of /usr/bin/python in the shebang line for each of your source files, this script will be a bit more portable. Specifically, it will work properly if someone tries to wrap it in a virtualenv, like I did :)

Here's the super simple .diff that worked for me

diff --git a/mnetsuite/graph.py b/mnetsuite/graph.py
index fd00566..e7a35ee 100755
--- a/mnetsuite/graph.py
+++ b/mnetsuite/graph.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python

 '''
        MNet Suite
diff --git a/mnetsuite/node.py b/mnetsuite/node.py
index a8a7566..f8d46e6 100755
--- a/mnetsuite/node.py
+++ b/mnetsuite/node.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python

 '''
        MNet Suite
diff --git a/mnetsuite/snmp.py b/mnetsuite/snmp.py
index 31a4d49..efd2071 100755
--- a/mnetsuite/snmp.py
+++ b/mnetsuite/snmp.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python

 '''
        MNet Suite

Thanks!

How do you get this to work?

I'm happy to be the guy in the room asking the dumb question: how do you get this software to work? I can't get mnet to work, nor can I get this to work. Do you have anything that might help people get started with installing it?
Here's exactly what I did on my computer, which is running macOS High Sierra 10.13.5

brew install python3
cd /usr/local/bin
git clone https://github.com/MJL85/natlas.git
cd natlas
chmod +x natlas-cli.py

It all installs as expected - but when I run it with something like just a standard check to see that things are where they should be, I get the following output:

sudo python3 natlas-cli.py list
natlas v0.11-dev6
Michael Laforest <[email protected]>
Python 3.6.5

Traceback (most recent call last):
  File "natlas-cli.py", line 306, in <module>
    main(sys.argv[1:])
  File "natlas-cli.py", line 76, in main
    modules = load_modules()
  File "natlas-cli.py", line 119, in load_modules
    for f in os.listdir(working_dir + '/modules'):
FileNotFoundError: [Errno 2] No such file or directory: '/modules'

Running other commands produce similar output, even when using full paths:

sudo python3 natlas-cli.py diagram -c /usr/local/bin/natlas/natlas.conf -r 172.20.24.1 -o /usr/local/bin/natlas/network.pdf
natlas v0.11-dev6
Michael Laforest <[email protected]>
Python 3.6.5

Traceback (most recent call last):
  File "natlas-cli.py", line 306, in <module>
    main(sys.argv[1:])
  File "natlas-cli.py", line 76, in main
    modules = load_modules()
  File "natlas-cli.py", line 119, in load_modules
    for f in os.listdir(working_dir + '/modules'):
FileNotFoundError: [Errno 2] No such file or directory: '/modules'

I'm hoping that there's just a tweak or two I need to administer to get this working. Can you please offer any insight? I'd love to try this out - thank you in advance!

LLDP discovery - Neighbors not discovered.

Hi,

I'm running a QFX stack and a EXT4200 and it doesn't seem like Natlas is able to discover the neighbors when starting at each device. It shows the root device okay but doesn't jump to anything else.

natlas v0.12.1
Michael Laforest <[email protected]>
Python 3.6.5

     Config file: ./natlas.conf
     Output file: /topology_image/topology-2018-08-30-04-41-42.pdf
Out Catalog file: None
       Root node: 10.0.42.14
  Discover depth: 100
   Diagram title: natlas Diagram

Discovery codes:
    . depth             ! connection error
    + discovering node  > numerating adjacencies
    i include node      L leaf node

Discovering network...
1  [root]  +Switch DI4 (10.0.42.14)
   [root]  >Switch DI4 (10.0.42.14)

Collecting node details...
[1/1]+ Switch DI4 (10.0.42.14) 8.44 sec

Back filling node details...
Created diagram: /topology_image/topology-2018-08-30-04-41-42.pdf

Completed in 0:0:13.33s

The LLDP configuration on each switch looks like the following

set protocols lldp management-address $MANAGEMENT_IP_HERE
set protocols lldp port-id-subtype interface-name
set protocols lldp interface all
set protocols lldp-med interface all

Walking the OIDS that are hard-coded for LLDP does seem to return data but I'm not sure where

.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemChassisIdSubtype.9271.647.1 = INTEGER: macAddress(4)
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemChassisId.9271.647.1 = Hex-STRING: 78 FE 3D 5A 05 3A 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemPortIdSubtype.9271.647.1 = INTEGER: local(7)
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemPortId.9271.647.1 = STRING: "578"
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemPortDesc.9271.647.1 = STRING: ge-0/0/8
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemSysName.9271.647.1 = STRING: core-01
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemSysDesc.9271.647.1 = STRING: Juniper Networks, Inc. qfx3500s Ethernet Switch, kernel JUNOS 15.1R7.8, Build date: 2018-04-27 21:10:13 UTC Copyright (c) 1996-2018 Juniper Networks, Inc.
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemSysCapSupported.9271.647.1 = BITS: 28 bridge(2) router(4) 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemTable.lldpRemEntry.lldpRemSysCapEnabled.9271.647.1 = BITS: 28 bridge(2) router(4) 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemManAddrTable.lldpRemManAddrEntry.lldpRemManAddrIfSubtype.82328459.647.1.ipV4."..*." = INTEGER: unknown(1)
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemManAddrTable.lldpRemManAddrEntry.lldpRemManAddrIfId.82328459.647.1.ipV4."..*." = INTEGER: 0
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemManAddrTable.lldpRemManAddrEntry.lldpRemManAddrOID.82328459.647.1.ipV4."..*." = OID: .iso.org.dod.internet.mgmt.mib-2.ifMIB.ifMIBObjects.ifXTable.ifXEntry.ifName.0
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.1 = Hex-STRING: 00 12 0F 01 03 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.2 = Hex-STRING: 00 12 0F 03 03 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.3 = Hex-STRING: 00 12 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.4 = Hex-STRING: 00 90 69 01 50 33 35 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.5 = Hex-STRING: 00 80 C2 03 00 2A 07 76 6C 61 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.6 = Hex-STRING: 00 80 C2 03 00 60 07 76 6C 61 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.7 = Hex-STRING: 00 80 C2 03 00 63 07 76 6C 61 
.iso.std.iso8802.ieee802dot1.ieee802dot1mibs.lldpMIB.lldpObjects.lldpRemoteSystemsData.lldpRemOrgDefInfoTable.lldpRemOrgDefInfoEntry.lldpRemOrgDefInfo.9271.647.1.'...'.1.8 = Hex-STRING: 00 12 BB 

Anything else I can check on my side?

NatLas.Conf - What do I need to add here

Hi Team,

Below is snip of NatLas.Conf file, I am confused as there is no how to do guide and I am a noob with scripting

  1. Could you please advise if I have to if below is correct if my snmp string is example - "C1sC0"

Does this looks right?
"snmp" : [
{ "community":"C1sC0", "ver":2 },
{ "community":"C1sC0", "ver":2 }

  1. And what do I need to add under "domains"? Can I leave it as it is or do i need to add anything here?

    "domains" : [
    ".company.net",
    ".company.com"

  2. What does "discover" do? does it add ACL on the devices? or is it for the script to scan the IP range? if so then can I delete all the other permit lines and leave this one only?

    "discover" : [
    "permit ip 192.168.1.0/24",

  3. Do I need to change anything under "diagram", or leave it as default ?

    "diagram" : {
    "node_text_size" : 10,
    "link_text_size" : 9,
    "title_text_size" : 15,
    "get_stack_members" : 0,
    "get_vss_members" : 0,
    "expand_stackwise" : 0,
    "expand_vss" : 1,
    "expand_lag" : 1,
    "group_vpc" : 0
    }
    }

Any help would be greatly apprecaited, i would have loved if there was anyhow to do a guide on here

Regards
Jessica

Nexus 5672 root switch not seeing it's neighbor via LLDP

I have two core switches directly connected to each other - named crsw01 and crsw02. They are Cisco Nexus 5672UP running 7.1(0)N1(1a). Pointing mnet at crsw01 as the root, with CDP enabled on both crsw01/02 and everything seems to work fine. If I disable CDP and just leave LLDP, crsw02 is never discovered.

Snmpwalks show all the neighbors, but I did notice some things that may be throwing the script off:

-- entry showing neighbor name of crsw02

LLDP-MIB::lldpRemSysName.0.436383744.0 = STRING: crsw02.company.com

-- the other switches are IOS and have a different string ... this is crsw02 neighbor (not working) ....

LLDP-MIB::lldpRemSysDesc.0.436383744.0 = STRING: Cisco Nexus Operating System (NX-OS) Software 7.1(4)N1(1)
TAC support: http://www.cisco.com/tac
Copyright (c) 2002-2016, Cisco Systems, Inc. All rights reserved.

-- ... and here is IOS neighbor (is working) - i remember seeing references to "Version" somewhere, which the NXOS switch lacks, not sure if that is relevant

LLDP-MIB::lldpRemSysDesc.0.436215808.0 = STRING: Cisco IOS Software, Catalyst 4500 L3 Switch Software (cat4500-ENTSERVICESK9-M), Version 15.0(2)SG10, RELEASE SOFTWARE (fc1)
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2015 by Cisco Systems, Inc.
Compiled Tue 07-Apr-15 09:46 by

-- and then there is this .... this port is the only "all802" sub-tree entry - the rest are ipV4.

LLDP-MIB::lldpRemManAddrIfSubtype.0.436383744.0.all802.".`OZYS" = INTEGER: ifIndex(2)

LLDP-MIB::lldpRemManAddrIfId.0.436383744.0.all802.".`OZYS" = INTEGER: 83886080

LLDP-MIB::lldpRemManAddrOID.0.436383744.0.all802.".`OZYS" = OID: SNMPv2-SMI::zeroDotZero.0

Let me know if there is additional info I can provide or testing I can do. Thank you!

Couldn't import dot_parser, loading of dot files will not be possible.

I'm getting the following error when I run mnet.py. What am I missing? I am using Python version 3.6.1.

Traceback (most recent call last):
File "C:\Program Files\Python36\Scripts\mnet.py", line 32, in
import mnetsuite
File "C:\Program Files\Python36\lib\site-packages\mnetsuite_init_.py", line 1, in
from .graph import mnet_graph
File "C:\Program Files\Python36\lib\site-packages\mnetsuite\graph.py", line 34, in
from snmp import *
ModuleNotFoundError: No module named 'snmp'

init error

I'm running Python 2.7.10.

 $ ./mnet-graph.py -r x.x.x.x -f gscnetwork.svg -d 10 -c ./mnet.conf
MNet-Graph v0.1
Written by Michael Laforest <[email protected]>

Config file: ./mnet.conf
  Root node: x.x.x.x
Output file: gscnetwork.svg
Crawl depth: 10
Diagram title: MNet Network Diagram

Traceback (most recent call last):
  File "./mnet-graph.py", line 666, in <module>
    main(sys.argv[1:])
  File "./mnet-graph.py", line 487, in main
    crawl_node(opt_root_ip, opt_depth)
  File "./mnet-graph.py", line 256, in crawl_node
    system_name = shorten_host_name(get_snmp_val(ip, OID_SYSNAME) or 'UNKNOWN')
  File "./mnet-graph.py", line 109, in get_snmp_val
    cmdgen.CommunityData(community),
TypeError: __init__() takes at least 3 arguments (2 given)

FileNotFoundError: [Errno 2] "dot" not found in path.

Getting this error with every IP I try..

abooda@xx:~/Network-Discovery/natlas$ python3 natlas-cli.py diagram -r 10.168.4.17 -o .\network.svg
natlas v0.12.1
Michael Laforest [email protected]
Python 3.6.7

 Config file: ./natlas.conf
 Output file: .network.svg

Out Catalog file: None
Root node: 10.168.4.17
Discover depth: 100
Diagram title: natlas Diagram

Discovery codes:
. depth ! connection error
+ discovering node > numerating adjacencies
i include node L leaf node

Discovering network...
1 [root] +architec_bourkest_fo_dsl_vpn (10.168.4.17)
[root] >architec_bourkest_fo_dsl_vpn (10.168.4.17)

Collecting node details...
[1/1]+ architec_bourkest_fo_dsl_vpn (10.168.4.17) 3.07 sec

Back filling node details...
Traceback (most recent call last):
File "/home/abooda/.local/lib/python3.6/site-packages/pydot.py", line 1915, in create
working_dir=tmp_dir,
File "/home/abooda/.local/lib/python3.6/site-packages/pydot.py", line 136, in call_graphviz
**kwargs
File "/usr/lib/python3.6/subprocess.py", line 709, in init
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1344, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "natlas-cli.py", line 305, in
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 88, in mod_entry
if (opt_output != None): natlas_obj.write_diagram(opt_output, opt_title)
File "/home/abooda/Network-Discovery/natlas/natlas/natlas.py", line 125, in write_diagram
self.diagram.generate(output_file, diagram_title)
File "/home/abooda/Network-Discovery/natlas/natlas/output_diagram.py", line 108, in generate
output_func(f)
File "/home/abooda/.local/lib/python3.6/site-packages/pydot.py", line 1734, in new_method
encoding=encoding)
File "/home/abooda/.local/lib/python3.6/site-packages/pydot.py", line 1817, in write
s = self.create(prog, format, encoding=encoding)
File "/home/abooda/.local/lib/python3.6/site-packages/pydot.py", line 1922, in create
raise OSError(*args)
FileNotFoundError: [Errno 2] "dot" not found in path.

Question: Remove VLAN info in the shapes

Hi,

I'm trying to create a diagram with no VLAN information in the shapes.
I've read the docs and in the question Q3, the solution should be
"diagram" : {
node_text = '{node.name}
{node.ios}
{node.plat}'
}

So I have added this to the configuration file natlas.conf , but that doesn't work.
So in which file should I make the above changes?

Thanks for your help.

Unable to connect snmp error

it might be something simple we missed but we keep getting an unable to connect snmp error
we did an snmp walk using snmp version 1 to a cisco 3750 and a dell 5524 and both work

when we try via the app it says unable to connect snmp error
we re-created the json file to test if it was that but get the same error

Enhancement request: EIGRP

Any testing I can help with to get EIGRP added?
Maybe have a way to add additional devices that don't show up in CDP like ASA's? Could possibly find the port using your MAC trace tool? Great stuff man.

ValueError: invalid literal for int() with base 0: '10.10.10.10'

Had an issue where this was crashing 3/4 way through a scan.

It looks like the Cisco WAAS returns a string for the IP OID rather than a hex value?

Saw a similar issue from 2015 and managed to fix it my adding the following to util.py:
def convert_ip_int_str(iip):
if ((iip != None) & (iip != '') & (iip.startswith("0x"))):

Seems to fix it?

Edit: Awesome project by the way, saves so much time! Combined the catalogue output with a script I wrote that iterates through that CSV and calls the bash script here https://packetpushers.net/bash-script-to-gather-all-your-cisco-serial-numbers-via-snmp/ for a full inventory list and map!

natlas should output both svg diagram and DOT file format

Sometimes it's useful to tweak the information or rendering of the auto-generated .svg map; however, all known editing tools for .svg format (such as inkscape) do not offer any real way to rearrange nodes without much pain.

In some cases, it's easier to change the DOT source itself and redraw / render the svg. I forked natlas and created a -D option to create a dot file along with the automatic diagram.

Please see the PR for changes and consider merging the PR in.

AttributeError: 'str' object has no attribute 'version'

ruffedgrouse@mint-linux-vm ~/Documents/mnet-master $ sudo ./mnet-graph.py -r x.x.x.x -d 20 -f Network.svg -t "NETWORK DIAGRAM"
MNet-Graph v0.3
Written by Michael Laforest [email protected]

Config file: ./mnet.conf
Root node: x.x.x.x
Output file: Network.svg
Crawl depth: 20
Diagram title: NETWORK DIAGRAM
Out Catalog file: None

Traceback (most recent call last):
File "./mnet-graph.py", line 763, in
main(sys.argv[1:])
File "./mnet-graph.py", line 559, in main
crawl_node(opt_root_ip, opt_depth)
File "./mnet-graph.py", line 277, in crawl_node
if (is_node_allowed(ip) == 0):
File "./mnet-graph.py", line 425, in is_node_allowed
if (ip in IPNetwork(e)):
File "/usr/lib/python2.7/dist-packages/netaddr/ip/init.py", line 720, in contains
if self.version != other.version:
AttributeError: 'str' object has no attribute 'version'

Working dir error

I get the following error when I try to run natlas-cli both on windows and Linux.
If i change os.listdir on line 119 to only contain './modules' everything works.

rael@fw:~/natlas$ python3 natlas-cli.py diagram -r 10.10.0.1 -o test.svg
natlas v0.11-dev6
Michael Laforest <[email protected]>
Python 3.6.5

Traceback (most recent call last):
  File "natlas-cli.py", line 306, in <module>
    main(sys.argv[1:])
  File "natlas-cli.py", line 76, in main
    modules = load_modules()
  File "natlas-cli.py", line 119, in load_modules
    for f in os.listdir(working_dir + '/modules'):
FileNotFoundError: [Errno 2] No such file or directory: '/modules'
rael@fw:~/natlas$ ls
CHANGELOG  LICENSE      modules  natlas-cli.py  README.md
docs       MANIFEST.in  natlas   natlas.conf    setup.py
rael@fw:~/natlas$

Great tool by the way.

mnet not discovering network

Hi,
I'm trying to discover part of our network. I start at that sites core switch and it gets discovered without issues. But the scripts says that it found 0 links. The core is a pair of 6506 running VSS and bootdisk:/s2t54-adventerprisek9_npe-mz.SPA.152-1.SY3.bin (from the devices file).
Here is the output of mnet.py:
Config file: network.txt
Root node: 10.18.224.1
Output file: network.png
Crawl depth: 10
Diagram title: MNet Network Diagram
Out Catalog file: devices.txt

  +***SW01 (10.18.224.1)
  >***SW01 (10.18.224.1)

----- DEVICES


  Name: ***SW01
    IP: 10.18.224.1

Platform: None
IOS Ver: None
Routing: yes
OSPF ID: 10.255.224.1
BGP LAS: 65100
HSRP Pri: None
HSRP VIP: None
VSS Mode: 1
VSS Domain: 50
VSS Slot 0:
IOS: None
Serial: None
Platform: None
VSS Slot 1:
IOS: None
Serial: None
Platform: None
Stack Cnt: 0
Loopbacks:
Not configured.
SVIs:
Not configured.
Links:
Discovered devices: 1
Discovered links: 0
Created graph: network.png

I have the subnet included in the settings file:
"subnets" : [
"10.18.224.0/24"

There are currently 9 switches connected to this main switch and all of them have cdp enable. Walking 1.3.6.1.4.1.9.9.23 shows them just fine. Not sure how the script discovers them.

Anybody have a hint what could be happening?

I'm using Python 2.7 on Windows Server 2012 R2.

cannot concatenate 'str' and 'int' objects

$ ./mnet-graph.py -r x.x.x.x -d 20 -f foo.svg -t "Network Diagram" -c ./mnet.conf
Couldn't import dot_parser, loading of dot files will not be possible.
MNet-Graph v0.1
Written by Michael Laforest <[email protected]>

    Config file: ./mnet.conf
      Root node: x.x.x.x
    Output file: foo.svg
    Crawl depth: 20
  Diagram title: Network Diagram



router-name (x.x.x.x)
-----
----- DEVICES
-----
      Name: router-name
        IP: x.x.x.x
  Platform: UNKNOWN
   Routing: yes
   OSPF ID: x.x.x.x
   BGP LAS: 65001
  HSRP Pri: None
  HSRP VIP: None
 Stack Cnt: 0
  VSS Mode: 0
VSS Domain: None

-----
----- LINKS
-----
-----
----- Summary
-----
Discovered devices: 1
Discovered links:   0
Traceback (most recent call last):
  File "./mnet-graph.py", line 666, in <module>
    main(sys.argv[1:])
  File "./mnet-graph.py", line 492, in main
    output_dot(opt_dot, opt_title)
  File "./mnet-graph.py", line 661, in output_dot
    output_func(dot_file)
  File "/Library/Python/2.7/site-packages/pydot.py", line 1602, in <lambda>
    lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog))
  File "/Library/Python/2.7/site-packages/pydot.py", line 1696, in write
    dot_fd.write(self.create(prog, format))
  File "/Library/Python/2.7/site-packages/pydot.py", line 1740, in create
    self.write(tmp_name)
  File "/Library/Python/2.7/site-packages/pydot.py", line 1694, in write
    dot_fd.write(self.to_string())
  File "/Library/Python/2.7/site-packages/pydot.py", line 1452, in to_string
    graph.append( node.to_string()+'\n' )
  File "/Library/Python/2.7/site-packages/pydot.py", line 722, in to_string
    node_attr.append( attr + '=' + quote_if_necessary(value) )
TypeError: cannot concatenate 'str' and 'int' objects

Feature Request: Specify hostname to IP instead of relying on "CDP ne IP"

During discovery, the IP address of the next host is learned using the CDP or LLDP neighbor IP advertisement. This is a problem in the Cisco world as "source cdp interface" does not exist on the majority of platforms; thus the lowest interface IP is used. In large environments this IP is very likely not accessible from a management station as most environments will have a management address set.

Since there seems to be no reliable way to set the advertised "source IP" in CDP/LLDP updates on the Cisco platform, it would be incredibly helpful for Natlas to reference the system's /etc/hosts file before the advertised address.

Any pointers on how to accomplish this?

Thanks,

Errors on all platforms, all seed devices

I am having a heck of a time getting this up and going. After sorting through some pydot/pydot2 issues, I was able to get the script to at least execute. However, every time I try to run it, I get the following errors:

Traceback (most recent call last):
  File "/usr/local/bin/mnet.py", line 198, in <module>
    main(sys.argv[1:])
  File "/usr/local/bin/mnet.py", line 67, in main
    graph(argv[1:])
  File "/usr/local/bin/mnet.py", line 129, in graph
    graph.crawl(opt_root_ip)
  File "/usr/local/lib/python2.7/dist-packages/mnetsuite/graph.py", line 92, in crawl
    n.query_node()
  File "/usr/local/lib/python2.7/dist-packages/mnetsuite/node.py", line 485, in query_node
    self._get_chassis_info()
  File "/usr/local/lib/python2.7/dist-packages/mnetsuite/node.py", line 809, in _get_chassis_info
    self.ios = self._format_ios_ver(self.ios)
  File "/usr/local/lib/python2.7/dist-packages/mnetsuite/node.py", line 831, in _format_ios_ver
    img_s = re.search('(Version:? |CCM:)([^ ,$]*)', img)
  File "/usr/lib/python2.7/re.py", line 142, in search
    return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

Any idea what I am doing wrong here?

ValueError: invalid literal for int() with base 0: ''

I ran the latest mnet.py graph solution and encountered an error. I'm not sure if it's because there are too many device entries or if my depth setting is too steep. I did a dry run by setting a depth of 0 and 1 to ensure that all dependencies were properly installed which finished successfully.

This instance was given a depth of 10. Not too sure if that's too deep but it did correctly detect devices down to a depth of 7.

I've uploaded the log to my Google Drive since I cannot directly upload .txt files. Though I've censored it it still shows all the steps and depth it was able to reach.

PyPI out of date

The version on PyPI is out of date. Is this no longer being maintained?

Traceback in format_ios_ver

This is seen when used against a Cisco Nexus 7000

$ mnet.py graph -r 10.108.18.4 -f test.png -d 2 -c mnet.conf
MNet Suite v0.8
Written by Michael Laforest [email protected]

 Config file: mnet.conf
   Root node: 10.108.18.4
 Output file: test.png
 Crawl depth: 2

Diagram title: MNet Network Diagram
Out Catalog file: None

  +l3n7k_76ad_ru34 (10.108.18.4)
  >l3n7k_76ad_ru34 (10.108.18.4)

Traceback (most recent call last):
File "/usr/local/bin/mnet.py", line 198, in
main(sys.argv[1:])
File "/usr/local/bin/mnet.py", line 67, in main
graph(argv[1:])
File "/usr/local/bin/mnet.py", line 129, in graph
graph.crawl(opt_root_ip)
File "/usr/local/lib/python2.7/dist-packages/mnetsuite/graph.py", line 92, in crawl
n.query_node()
File "/usr/local/lib/python2.7/dist-packages/mnetsuite/node.py", line 485, in query_node
self._get_chassis_info()
File "/usr/local/lib/python2.7/dist-packages/mnetsuite/node.py", line 809, in _get_chassis_info
self.ios = self._format_ios_ver(self.ios)
File "/usr/local/lib/python2.7/dist-packages/mnetsuite/node.py", line 831, in _format_ios_ver
img_s = re.search('(Version:? |CCM:)([^ ,$]*)', img)
File "/usr/lib/python2.7/re.py", line 142, in search
return _compile(pattern, flags).search(string)
TypeError: expected string or buffer

ImportError: No module named compat.octets

Hello All,

I am new to Github and Natlas, I have installed Natlas on my linux machine and when I try the below command it does not work for some reason.

[jessica@lab natlas-master]$ ./natlas-cli.py diagram -r 192.168.17.12 -o .\network.svg
Traceback (most recent call last):
File "./natlas-cli.py", line 35, in
import natlas
File "/home/jessica/ntls/natlas-master/natlas/init.py", line 2, in
from .natlas import natlas
File "/home/jessica/ntls/natlas-master/natlas/natlas.py", line 35, in
from .network import natlas_network
File "/home/jessica/ntls/natlas-master/natlas/network.py", line 29, in
from .util import *
File "/home/jessica/ntls/natlas-master/natlas/util.py", line 34, in
from .snmp import *
File "/home/jessica/ntls/natlas-master/natlas/snmp.py", line 27, in
from pysnmp.entity.rfc3413.oneliner import cmdgen
File "/usr/lib/python2.6/site-packages/pysnmp/entity/rfc3413/oneliner/cmdgen.py", line 1, in
from pysnmp.entity import engine, config
File "/usr/lib/python2.6/site-packages/pysnmp/entity/engine.py", line 2, in
from pysnmp.proto.rfc3412 import MsgAndPduDispatcher
File "/usr/lib/python2.6/site-packages/pysnmp/proto/rfc3412.py", line 3, in
from pyasn1.compat.octets import null
ImportError: No module named compat.octets

Regards
Jessica

HP ProCurve switch support

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 <[email protected]>

     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

Script launching issue - Windows

Hello guys,

After Python 3.7 installation on Windows 10 Enterprise, I'm trying to test this script on powershell.

I've specified the snmp v2 community on natlas.conf & also a permit ip xx.xx.xx.xx/24 in the discover part.

PS C:\Users\Thierry.ROUX\Desktop\Network Atlas> .\natlas-cli.py tracemac -n xx.xx.xx.xx -m xxxx.xxxx.xxxx

No result, I can see a black cmd windows which is here for 2 seconds and then nothing.

Same issue with diagram module with an expected output file.

Could you please assist me ?

Thanks in advance for your actions.

Best regards,

Thierry

Changing from depth "2" to depth "3" causes an error

I have used this at a couple of places now, fantastic tool! But for some reason, I can run this command at a customer of mine:

python3 natlas-cli.py diagram -r 192.168.0.10 -d 3 -o \network1.png -c natlas.conf -t first_title

...and I get this:

Back filling node details...
['dot', '-Tpng', '/tmp/tmpdg9d8o3d'] return code: 1

stdout, stderr:
b''
b"Error: /tmp/tmpdg9d8o3d: syntax error in line 128 near '['\n"

Traceback (most recent call last):
File "natlas-cli.py", line 305, in
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 88, in mod_entry
if (opt_output != None): natlas_obj.write_diagram(opt_output, opt_title)
File "/home/bkastor/natlas/natlas/natlas.py", line 125, in write_diagram
self.diagram.generate(output_file, diagram_title)
File "/home/bkastor/natlas/natlas/output_diagram.py", line 108, in generate
output_func(f)
File "/usr/lib/python3/dist-packages/pydot.py", line 1691, in
self.write(path, format=f, prog=prog))
File "/usr/lib/python3/dist-packages/pydot.py", line 1774, in write
s = self.create(prog, format)
File "/usr/lib/python3/dist-packages/pydot.py", line 1900, in create
assert p.returncode == 0, p.returncode
AssertionError: 1

...but when I run this command:

python3 natlas-cli.py diagram -r 192.168.0.10 -d 2 -o \network1.png -c natlas.conf -t first_title

It works great? I have tried digging around for a device that might be causing an issue, but this error doesn't point me in the right direction. Any hints as to what it might be? I have tried PNG and SVG.. the natlas.conf is the same between runs... Thanks for this awesome tool!!

Diagram Red lines

Can some explain to me what the Red and blue lines in the diagram mean? My blue lines seem to be 100% correct but the red lines are Wrong on the P:GIx/x but correct on C:GIx/x. I see this behavior with devices that are 2 layer 2 Hops away from the root.

Add snmp Location on Network Diagram

Hello, I would like to add to the script that also adds to the graphics the snmp location of the Cisco systems. Could you please guide me on where to make that modification?
I already appreciate your help. The script works perfectly.

Best regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.