4 Replies Latest reply on Mar 3, 2011 11:28 AM by caineschneider

    network map - associated nodes?

      I've dug around for this bit of information and haven't been able to come up with anything...

      I want to find out which nodes are associated with a network map.  I figured there might be a table showing the association between a map and the nodes but can't find such a thing.  I also poked through an OrionMap file in hexedit and didn't see anything obvious, although I may have overlooked it.  Any way to get this data or do I have to go through the SDK?

      We're putting up one of our network maps on the intranet site, and I think it would be nice to show the degraded node status for that particular map. 


        • Re: network map - associated nodes?

          In the Network Atlas, on the right hand side if you expand (click on the little +) a map you should see all of the objects associated with it in a hierarchical layout.

          Is this what you are looking for?

            • Re: network map - associated nodes?

              Er, left hand side that is.

                • Re: network map - associated nodes?

                  Er, yeah I know where to see the list in the designer tool, but I want to query the list. 

                  I was using hexedit to look at a map file and for some silly reason I chose a map that only includes other maps.  Once I picked a map that actually references nodes I can see that the list is stored in the .OrionMap file.  I probably can extract the node and interface list by reading the map file in T-SQL.


                  FYI, it looks something like this:

                  comment: "NetObjects=Orion.Nodes: 2352,Orion.Nodes: 2348,Orion.Nodes: 2350,Orion.Nodes: 2351,Orion.Nodes: 65,Orion.Nodes: 2353,Orion.Nodes: 2349,Orion.Nodes: 470,Orion.Nodes: 2363,Orion.Nodes: 2362,Orion.Nodes: 659,Orion.Nodes: 2529,Orion.Nodes: 2530,Orion.NPM.Interfaces: 2351|7285,Orion.NPM.Interfaces: 2348|7777,Orion.NPM.Interfaces: 2348|7755,Orion.NPM.Interfaces: 2348|7753,Orion.NPM.Interfaces: 470|268,Orion.NPM.Interfaces: 470|267,Orion.NPM.Interfaces: 2348|7760,Orion.NPM.Interfaces: 2351|7276,Orion.NPM.Interfaces: 65|32,Orion.NPM.Interfaces: 2348|7761,Orion.NPM.Interfaces: 2362|6085,Orion.NPM.Interfaces: 2348|7758,Orion.NPM.Interfaces: 2348|7757,Orion.NPM.Interfaces: 2529|7293,Orion.NPM.Interfaces: 2351|7270,Orion.NPM.Interfaces: 2530|7294,Orion.NPM.Interfaces: 2353|7844"


                    • Re: network map - associated nodes?

                      Perhaps this will help someone else...  Here's one way to parse the .OrionMap file and get the list of other objects (maps, nodes, interfaces, something else?) that are included within.  This only shows the pieces of data you can use, it doesn't actually do anything with the parsed data (that's for you to figure out).  You will need to set the appropriate value for @FileID. 

                      USE NetPerfMon

                      DECLARE @FileID uniqueidentifier
                      SET @FileID = 'BA0CF9FB-575A-4B2A-887B-9343A95A1754'

                      DECLARE @FileData nvarchar(MAX)
                      SELECT @FileData = CONVERT(nvarchar(max), CONVERT(varbinary(MAX), FileData)) FROM dbo.MapStudioFiles WHERE FileID = @FileID

                      DECLARE @strFind varchar(80), @startPos bigint, @endPos bigint
                      SET @strFind = 'comment: "NetObjects=' -- beginning of net objects list
                      SET @startPos = CHARINDEX(@strFind,@FileData) + LEN(@strFind)
                      SET @strFind = '"' -- end of the net objects list
                      SET @endPos = CHARINDEX(@strFind,@FileData,@startPos)
                      --PRINT @startPos
                      --PRINT @endPos

                      DECLARE @NetObjects varchar(MAX), @ObjectType varchar(80), @ObjectID varchar(80)
                      SET @NetObjects = SUBSTRING(@FileData, @startPos, @endPos - @startPos) + ',' -- add terminal delimiter
                      --PRINT @NetObjects

                      WHILE DATALENGTH(@NetObjects) > 0
                       PRINT '-------------------------------------------------------------'
                       PRINT '@NetObjects = ' + @NetObjects
                       PRINT 'DATALENGTH(@NetObjects) = ' + CONVERT(varchar, DATALENGTH(@NetObjects))
                       SET @strFind = ': '
                       SET @startPos = CHARINDEX(@strFind,@NetObjects)
                       IF @startPos = 0
                        SET @NetObjects = ''
                        PRINT 'String "' + @strFind + '" was not found.  Exiting WHILE loop.'
                        SET @ObjectType = LEFT(@NetObjects, @startPos - 1)
                        SET @startPos = @startPos + DATALENGTH(@strFind)
                        PRINT '@startPos = ' + CONVERT(varchar, @startPos)
                        SET @strFind = ','
                        SET @endPos = CHARINDEX(@strFind,@NetObjects,@startPos)
                        IF @endPos = 0 SET @endPos = DATALENGTH(@NetObjects)
                        PRINT '@endPos = ' + CONVERT(varchar, @endPos)
                        SET @ObjectID = SUBSTRING(@NetObjects, @startPos, @endPos - @startPos)
                        SET @NetObjects = SUBSTRING(@NetObjects, @endPos + 1, DATALENGTH(@NetObjects) - @endPos)
                        PRINT '@ObjectType = ' + @ObjectType
                        PRINT '@ObjectID = ' + @ObjectID