netbox-community / netbox-topology-views

A netbox plugin that draws topology views
Apache License 2.0
697 stars 61 forks source link

Unable to add or change images #44

Closed drbw closed 3 years ago

drbw commented 3 years ago

I'm trying to make the plugin use Cisco network topology icons from here: https://www.cisco.com/c/en/us/about/brand-center/network-topology-icons.html

For this, I downloaded the PMS 3015 EPS package, sanitized the file names to contain only lowercase alpha and dashes and converted them to PNG with ImageMagick.

However, the plugin seems to be unable to use or access them for some reason - I tried both creating new files and overwriting existing ones but it continues using the original icons. Even if I overwrite one of the default icons with another, this is not reflected in the topology view.

I'm using Netbox 2.9.2 in Docker. There are no apparent error messages in any of the logs. File permissions and mode are the same as the shipped images. Browser cache was of course cleared and a different browser was tried. (Chrome and Firefox.) The configuration.py with the plugin config is auto-generated from the files with Ansible and should be correct.

PLUGINS = [
'netbox_topology_views'
]

PLUGINS_CONFIG = {u'netbox_topology_views': {u'device_img': u'softswitch-pgw-mgc,ibm-tower,turret,iad-router,contact-center,15200,metro-1500,hootphone,pc,space-router,sattelite-dish,file-cabinet,voice-atm-switch,pbx-switch,directory-server,wireless,vault,centri-firewall,mobile-streamer,pc-adapter-card,nexus-5000,content-service-switch-1100,mediator,mdu,car,10700,netflow-router,host,mcu,class-4-5-switch,rf-modem,modem,pc-software,workgroup-director,iptc,lightweight-ap,services,generic-processor,tape-array,telecommuter-icon,cisco-unified-presence-server,microphone,file-server,key,optical-amplifier,standing-woman,firewall,ciscosecurity,system-controller,generic-gateway,multilayer-remote-switch,me-1100,3x72,content-transformation-engine,optical-services-router,protocol-translator,relational-database,storage-router,router-firewall,tv,wism,cisco-asa-5500,man-woman,axp,generic-building,handheld,longreach-cpe,ios-firewall,nce,ciscoworks,icm,wireless-bridge,wireless-router,gatekeeper,cddi-fddi,ip-telephony-router,layer-2-remote-switch,dslam,vsd,cs-mars,speaker,sip-proxy-werver,umg-series,simulitlayer-switch,bts-10200,virtual-layer-switch,cisco-unityexpress,gigabit-switch-atm-tag-router,upc,dual-mode-ap,pxf,iscsi-router,macintosh,government-building,wlan-controller,callmanager,content-switch-module,pbx,layer-3-switch,page-icon,wae,svx,cloud,radio-tower,cellular-phone,www-server,ace,printer,vpn-gateway,tp-mcu,cable-modem,wireless-transport,fibre-channel-fabric-switch,unity-server,octel,atm-tag-switch-router,standing-man,small-business,content-switch,content-engine,stp,intelliswitch-stack,6700-series,ssl-terminator,7500ars,running-man,truck,tdm-router,bridge,ata,fc-storage,microwebserver,keys,small-hub,jbod,service-router,mau,fax,dwdm-filter,acs,pc-man,wireless-location-appliance,router-with-silicon-switch,localdirector,carrier-routing-system,itp,route-switch-processor,accesspoint,diskette,hub,ground-terminal,cdm,dpt,branch-office,ibm-mini-as400,netranger,university,laptop,nac-appliance,ics,multi-fabric-server-switch,hp-mini,phone-fax,stb,router,meetingplace,server-switch,softphone,androgenous-person,atm-router,sattelite,universal-gateway,pc-routercard,mac-woman,mini-vax,csm-s,ubr910,bbfw,mgx-8000-multiservice-switch,nce-router,communications-server,mux,fibre-channel-disk-subsystem,internet-streamer,nexus-2000,routerin-building,streamer,general-applicance,asr-1000-series,standard-host,tablet,atm-fast-gigabit-etherswitch,voice-router,mulitswitch-device,lock,telecommuter-house-pc,adm,mobile-access-ip-phone,voice-commserver,pad-x-28,terminal,mobile-access-router,software-based-server,safeharbor-icon,cube,wi-fi-tag,transpath,access-gateway,workgroup-switch,asic-processor,voice-switch,100baset-hub,mxe,iptv-content-manager,detector,optical-transport,sun-workstation,network-management,vss,nexus-7000,server-with-router,phone,mesh-ap,antenna,token,front-end-processor,lan-to-lan,service-control,3200-mobile-access-router,telecommuter-house,h-323,ios-slb,distributed-director,nexus-1000,3174,ip-communicator,workstation,pmc,vpn-concentrator,wavelength-router,video-camera,avs,guard,10ge-fcoe,sitting-woman,dot-dot,mse,programmable-switch,content-service-router,bbfw-media,director-class-fibre-channel-director,set-top-box,moh-server,repeater,breakout-box,virtual-switch-controller,generic-softswitch,atm-switch,bbsm,fileserver,end-office,pad,pix-firewall,pc-video,csu-dsu,rpsrps,pda,ip-phone,web-browser,mas-gateway,isdn-switch,vip,netsonar,iptv-server,scanner,firewall-service-module,cisco-ca,cisco-1000,supercomputer,ip,ups,service-module,ibm-mainframe,storage-server,fddi-ring,ssc,ip-dsl,atm-3800,cisco-hub,broadband-router,ons15500,cisco-file-engine,ratemux,web-cluster', u'preselected_device_roles': u'Firewall,Router,Core Switch,Access Switch,Server,Storage,Wireless AP,Desktop'}}

The PNGs, according to file are:

firewall.png: PNG image data, 63 x 138, 16-bit/color RGB, non-interlaced

(Of varying sizes.) One thing that might lead to this is that the images need to be square, or 8-bit, or RGBA, or something else but your README doesn't specify and I've been unable to find out experimentally.

Side note -- the plugin clobbers my images every time the container is built or restarted which isn't very nice. It would be great to have a way of disabling the default images.

drbw commented 3 years ago

Argh. The static files are served directly from nginx, not from the Netbox container... that took me WAY too long to figure out. Working now.