Welcome, Guest. Please login or register.

Author Topic: NeDi2GrapML  (Read 52357 times)

OMFan

  • Guest
Re: NeDi2GrapML
« Reply #30 on: April 19, 2012, 01:39:05 pm »
Hello acoto,

I have just tried your last version and i have several questions about it :

  • Apparently, there is a new option when you execute perl script : -a. I don't find any documentation on it. Could you say me what is it ?
  • In NeDi, I have 40 buildings and i would like to create one File.GraphML by building. Is it possible ?

Thanks a lot for your answer.


acoto

  • Guest
Re: NeDi2GrapML
« Reply #31 on: April 19, 2012, 04:00:43 pm »
Hello OMFan,

The [-a] option was my first idea for IP Phone Autogroup, then I changed it to [-ipg], i did not noticed I left it on the help message. Got to correct it.

About individual GraphML files by building, not currently implemented in NeDi2GraphML. The logic to work it out seems complex at this point. Got to think about it.

Besides that, have you tried the grouping option?

You can group nodes by building, then in yEd select the group, Grouping-->View Group Contents. Yed Will Only show the elements inside the group.

Regards,

Adrian


OMFan

  • Guest
Re: NeDi2GrapML
« Reply #32 on: April 19, 2012, 04:52:34 pm »
Hello,

Thanks for your answer. I make a little modification on your perl script.

I have added one option and modify your SQL request.

I Will post it tomorrow if you are interested by this feature.

Bye.

acoto

  • Guest
Re: NeDi2GrapML
« Reply #33 on: April 19, 2012, 05:10:09 pm »
Cool. Please share your ideas.

Adrian

OMFan

  • Guest
Re: NeDi2GrapML
« Reply #34 on: April 26, 2012, 11:05:29 am »
Hello,

I share my modifications about your initial script.

I have just added --buil "string" option.

If you use it, only devices which contains "string" in their name will be on the GraphML.

For example, if you have 30 switches, and you have 10 switches with string like 'Miami' in their name, then only 10 switches will be appear :

Code: [Select]
perl NeDi2GraphML.pl -o File.GraphML --url http --icn icons.csv --buil Miami --edgelabels full
I know it's not very useful for everyone, but in my case, all our switches (approximatively 200) have one information about localization in their name.

So we generate as much maps as we have buildings.

Tell me if you have any ideas to optimize it.

Bye.
« Last Edit: April 26, 2012, 11:10:28 am by OMFan »

acoto

  • Guest
Re: NeDi2GrapML
« Reply #35 on: May 03, 2012, 10:26:11 pm »
Hello OMFan,

That is cool. Now, I wonder which will be more helpful, having the build option on the command line, or using an inclusion (filter) list in an external file, similar to the group list, and only add nodes if they match a statement on the list.

for instance...

perl NeDi2GraphML.pl -o File.GraphML --url http --icn icons.csv --nodefilter include.csv --edgelabels full

include.csv
incnode   cdpsvc   Router
incnode   devtype   ^Cisco-36
incnode   devtype   ^cisco26
incnode   location ^San Jose;Costa Rica
incnode   devname   ^RDist
incnode   devname   ^RAccs

That will permit to include nodes in several conditions.

What do you think?

Adrian

OMFan

  • Guest
Re: NeDi2GrapML
« Reply #36 on: May 04, 2012, 09:59:27 am »
Hello,

I think it is a very good idea which offers a lot of capabilities to build maps with only few devices !!!!!!!!!!!!!

If you have time for develop this functionnality, i will be your first personal tester  ;) ;)

acoto

  • Guest
Re: NeDi2GrapML
« Reply #37 on: May 05, 2012, 10:02:59 pm »
Hello,

NeDi2GraphML v0.15 is on Sourceforge now.

New option Device filters list. Thank You OMFan!!

Use devices filter to include/exclude devices based on specific characteristics.

perl NeDi2GraphML.pl -o Schematic.graphml --dfr devicefilter.csv

# Sample Devices Filter CSVFile
# Format:
#   devfilter, <type>, <regex>, <condition>
#
#      <type>:  "cdpsvc"   - CDP announced services: "Router" "Switch" "Bridge"...
#               "devtype"  - Device Type "Cisco-3640" "Cisco-3845"...
#               "location" - SNMP/NeDi Location Field "San Jose;Costa Rica"
#               "devname"  - Specific device Name "RCore001" "RAccess001" "SWDCT..."
#     <regex>:  matching regex
# <condition>:  "inc" Include
#               "exc" Exclude
#

devfilter,cdpsvc,Router,exc
devfilter,devtype,^Cisco-36,exc
devfilter,location,^San Jose;Costa Rica,inc
devfilter,devname,^RCore,inc



Note: There is a change on -n option. Now we only include nodes if parent device exists ( or it is not filtered out :) )

Adrian

ablkshrt1

  • Guest
Re: NeDi2GrapML
« Reply #38 on: May 08, 2012, 07:57:03 pm »
First off, great tool!

I am having a problem with how it links my CatOS devices.  CatOS reports device IDs a little different via CDP....it shows the serial number if you do a show CDP neighbor detail and just the name if your just do a show cdp neighbor.

My problem is that when your tool is building the links, it sees the serial number and thinks it is a missing device, and therefore never creates the link.  I am attaching a screenshot of my debug.  Can you help me out.
« Last Edit: May 08, 2012, 10:33:50 pm by rickli »

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2901
    • View Profile
    • NeDi
Re: NeDi2GrapML
« Reply #39 on: May 08, 2012, 10:38:19 pm »
This might actually be related to the discovery. I changed it around in order to support Nexus. Can you check around line 1460 of libsnmp.pm, whether the WS-C regexp matches or not?
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

acoto

  • Guest
Re: NeDi2GrapML
« Reply #40 on: May 08, 2012, 10:44:57 pm »
Hello Ablkshrt,

NeDi2GraphML takes the link information directly from NeDi Database. I think it may be better to clean the database input process than trying to correct it on the output side.

Can you share a "show version" and a "show cdp neighbor details" of the affected switch and some neighbors.

Remo, can you give us your opinion here

Regards

Adrian


rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2901
    • View Profile
    • NeDi
Re: NeDi2GrapML
« Reply #41 on: May 09, 2012, 09:39:05 pm »
Actually I forgot about a typo of mine:

-                                       if($lneb{"1.3.6.1.4.1.9.9.23.1.2.1.1.8.$k[14].$k[15]" =~ /^WS-C/}){
+                                       if($lneb{"1.3.6.1.4.1.9.9.23.1.2.1.1.8.$k[14].$k[15]"} =~ /^WS-C/){

(the line with a + replaces the line with a -. The curly bracket at the end needs to be before =
This should fix it...
« Last Edit: May 09, 2012, 09:41:34 pm by rickli »
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

acoto

  • Guest
Re: NeDi2GrapML
« Reply #42 on: May 10, 2012, 12:47:23 am »
Great catch Remo!

Thank You!

Adrian

ablkshrt1

  • Guest
Re: NeDi2GrapML
« Reply #43 on: May 10, 2012, 05:59:18 pm »
Fixing the typo fixed my issue. Thanks to this tool and Nedi, I finally have an updated network map (5 years in the waiting)

I do have a feature request.  It is great to be able to filter the devices, it would be equally great to be able to filter nodes.  If I could filter nodes by IP, Name, MAC and whatever other methods you can think of, it would be a huge help.  Also, Nedi already does a good job of using png icons for nodes.  Is there a way to get the nodes to show up in yEd with the same icons that are found in Nedi. That would make identification of nodes very easy.

Also, when I add nodes to my graph and do a Tree layout, is there a way to get it to order the nodes by port number....right now it is very random.

acoto

  • Guest
Re: NeDi2GrapML
« Reply #44 on: May 11, 2012, 07:15:10 am »
Hello ablkshrt1,

Node filters... good idea, almost done. uploading now.

PNG icons...yuck!.. I do not like bitmaps on my network schematics...
  one of my main goals when I started on this project was to get nice schematics. Vector graphics are a must if you want to print...
  may we can work on the other way around, instead of using png, we can try to get/make all requiered icons in SVG format,
  my current icon gallery is just a start :)

About the ordering of nodes/ports... yEd do not work on that way.
  My best shot to get ordered, consistent schematics is to use auto-layouts, then finetune by hand,
  then, export coordinates in a CSV File (geo file: devicename,coordX,coordY), and use it as geo file on NeDi2GraphML


Regards,

Adrian