3 Replies Latest reply on May 4, 2010 9:35 AM by michalB

    Automating the addition of Map backgrounds

    terrys1026

      I have hundreds of network drawings in Visio and I think I can automate getting a PNG snapshot of each drawing.  I'd like to automate the import of the drawings into NPM.  Is there a .NET script that I can examine that shows how to add a new background image to the NPM map database?

      Thanks!

        • Re: Automating the addition of Map backgrounds
          michalB

          What is exactly you are trying to achieve?

            • Re: Automating the addition of Map backgrounds
              terrys1026

              I have 300 - 500 sites and each site is documented in Visio.  While it might be nice to draw it in Network Atlas, we don't have the time available to do it right now.  I have a top-level map showing each site.  I want to take the visio drawing for each site (perhaps a PNG of the drawing) and load it into SW and link each site on the main map to the drawing of that site.  This means that I need to generate the FileId and make the *.PNG file a *.OrionMap file.  I'd really rather not do that process manually.  Is there a way I can automate/script it?  I'd rather spend a day automating it than a week doing them manually.

              I also discovered yesterday that the map FileId that's in the MapStudioFiles table is a series of hex digits, using uppercase letters, bracketed by braces, e.g. "{397F27A5-8F36-45C2-9B0E-9558E3D8718D}".  But when input into the browser, the characters must be lowercase, so you can't use the FileId field directly.  The FileId string must have the braces removed, converted to lowercase letters, and append ".OrionMap" (mixed case).  The result will be something like:

              http://sw-server/Orion/NetPerfMon/NetworkMap.aspx?Map=397f27a5-8f36-45c2-9b0e-9558e3d8718d.OrionMap&Scale=0

                • Re: Automating the addition of Map backgrounds
                  michalB

                  The FileID is a GUID, so you can use the System.Guid class from .NET to parse it and to convert it to string.

                  If I were you, I would start with creating a blank map with a background image. Export the map into a map file (main menu -export-export map). You may use this file as a template for new maps. If you open the map file (in notepad), you will find 2 references to the background image and to the actual map file (with different extension - .tmp). 

                  For each map, create a separate background image and a map file. Name the map file and the background image with one name (like map1.jpg + map1.OrionMap) and change the paths to the background file and to the map file in the map file (Keep the .tmp extension in the map file reference, just change the name). 

                  When the files are created and stored in one folder, use the ImportMapBatch tool (located in Program Files\SolarWinds\Orion\Network Atlas) to import all the maps to the database.