Now,
For a better looking schematic, we can add SVG icons!
The option "--icn icons.csv" instructs NeDi2GrapML to use the references in "icons.csv" and add icons to schematic.
"icons.csv" is a comma separated values file, with the next format per line:
# icon,<type>,<regex>,<link>,<width>,<weight>,<boxcolor>
#
# <type>: "cdpsvc" - CDP announced services: "Router" "Switch" "Bridge"...
# "devtype" - Device Type "Cisco-3640" "Cisco-3845"...
# "devname" - Specific device Name "RCore001" "RAccess001" "SWDCT..."
# <regex>: matching regular Expression
# <link>: file location
# <width>: icon width
# <height>: icon height
# <boxcolor>: color used when no icon, or zoom out
NeDi2GraphML will follow next type priority: devname > devtype > cdpsvc
An Example File:
icon,cdpsvc,Router,./icons/cisco/blue/router.svg,32,24,#0065A2
icon,cdpsvc,Bridge,./icons/cisco/blue/switch.svg,36,24,#0065A2
icon,devtype,^Node,./icons/cisco/grey/generic-pc.svg,20,20,#707070
icon,devtype,^Hub,./icons/cisco/cyan/hub-small.svg,32,24,#00B38A
icon,devtype,^Cisco-364,./icons/cisco/blue/router.svg,32,24,#0065A2
icon,devtype,^Cisco-720,./icons/cisco/blue/router-mpls.svg,32,24,#0065A2
icon,devname,^RCore,./icons/cisco/red/router-mpls-p.svg,48,48,#CC092F
icon,devname,^RDist,./icons/cisco/orange2/router-mpls-pe.svg,48,40,#FF5A00
The first two lines will place generic router and switch icons to devices that match "Router" or "Bridge" capabilities on CDP.
The next four lines will add icons, to specific device types "Node" "Hub" "Cisco-364x" and "Cisco-720x".
The final two lines, will add icons to specific device names.
The last column is a bit cryptic. When zooming out in yEd, at some point it will replace the SVG icon for an squared box. That column tells yEd to use an specific color for the box.
Now, after we modified icons.csv file to our specific needs, we can proceed:
perl NeDi2GraphML.pl -o NiceSchematic.graphml --icn icons.csv
Get the file. Have fun!
A note:
NeDi2Graph.pl may add some "Hubs" when it thinks the real topology has them.
A couple extra options:
"-n" will add NeDi nodes (aka endpoints) (be careful, may be slow and memory consuming)
"--edgelabels full" will add labels containing interface names
perl NeDi2GraphML.pl -o NSEdgeLabels.graphml -n --edgelabels full --icn icons.csv