Automatic Map Creation Specification

From OpenNMS
Jump to navigation Jump to search

Automatic Map Creation

Maps are automatically created when nodes are provisioned into OpenNMS. Notes will be organized, when applicable, into site map containers and wireless links connecting the sites will automatically be created. Site map containers and the network entities/elements (a.k.a. nodes) will represented with a status color.

Strategy

  • Use the Map Provisiond Adapter to create the maps.
  • Map hierarchy is manually created in mapsadapter-configuration.xml. The map adapter propulates the maps.
  • Links are created by an a 'link adapter' that uses name patterns to determine what links exist.

Acceptance Criteria

To verify the function of this User Story use the following steps

Step 1

Install the opennms-map-provisioning-adapter and opennms-link-provisioning-adapter

Step 2

User configured maps in mapsadapter-configuration.xml to define maps and submaps. This map creation is pattern matching based for assign nodes to maps.

Note: This is function that already exists in the opennms-map-provisioning-adapter

The XML below does the following:

  1. Creates toplevel map called nc-ral containing icons Ral Site 1 and Ral Site 2
  2. Creates maps associated with each of the 'Ral Site' icons called nc-ral0001' and ';nc-ral0002 respectively.
  3. Adds all of the nodes while nodeLabels matching nc-ral0001-* and nc-ral0002-* to the appropriate maps.
Map Adapter Configuration Example
 <?xml version="1.0"?> 
 <maps-adapter-configuration element-dimension="50"> 
   <package name="nc-ral0001"> 
     <filter>nodeLabel like 'nc-ral0001-%'</filter> 
     <include-range begin="1.1.1.1" end="254.254.254.254" /> 
   </package> 
   <package name="nc-ral0002"> 
     <filter>nodeLabel like 'nc-ral0002-%'</filter> 
     <include-range begin="1.1.1.1" end="254.254.254.254" /> 
   </package> 
   <cmaps> 
     <cmap mapName="nc-ral" mapOwner="admin" mapAccess="RW" mapWidth="800" mapHeight="600"> 
       <csubmap name="nc-ral0001" label="Ral Site1" x="485" y="350" /> 
       <csubmap name="nc-ral0002" label="Ral Site2" x="485" y="450" /> 
     </cmap> 
     <cmap mapName="nc-ral0001" mapOwner="admin" mapAccess="RW" mapWidth="800" mapHeight="600"> 
       <celement package="nc-ral0001" icon="switch"/> 
     </cmap> 
     <cmap mapName="nc-ral0002" mapOwner="admin" mapAccess="RW" mapWidth="800" mapHeight="600"> 
       <celement package="nc-ral0002" icon="switch"/> 
     </cmap> 
   </cmaps>  
 </maps-adapter-configuration>

Step 3

Configure the Link Adapter to create links based on naming conventions on the nodes.

The idea here is to create link based on the nodeLabel for the node. The below configuration is a possible way to indicate via configuration the way links can be created and is subject to change but will give an idea of how this can be accomplished.

Link Adapter Configuration Example
 <?xml version="1.0"?> 
 <link-adapter-configuration> 
   <for match="([a-z]{2})-([a-z]{3})([0-9]{4})-to-([a-z]{3})([0-9]{4})-link"> 
     <link>$1-$4$5-to-$2$3-link</link> 
   </for> 
   ... 
 </link-adapter-configuration> 

which means

if a nodeA matches:

([a-z]{2})-([a-z]{3})([0-9]{4})-to-([a-z]{3})([0-9]{4})-link

and nodeB exists that matches:

$1-$4$5-to-$2$3-link

where $n is the nth matching group from the regex for nodeA, then make a link from nodeA to nodeB.

Note: Use the node whose name comes first in String order as the parent node for the link. If a pair already has link the link is left alone.

Step 4

Start OpenNMS

Step 5

Provision the nodes into the system as they will be represented in the production environment (ie they match the patterns as defined in the mapsadapter-configuration.xml file)

Provision the following nodes using a provisioning requisition (or the DNS Provisioning Adapter but that's not necessary)

 nc-ral0001-wwp-311v 
 nc-ral0001-to-ral0002-link 
 nc-ral0002-wwp-311v 
 nc-ral0002-to-ral0001-link 

Step 6

After provisioning has been completed and the mapsadapter has run, verify that the following maps exist and that they are properly linked.

 Map - nc-ral 
  | 
  --> Ral Site1 (linked to Ral Site2) 
  | | 
  | -->Submap nc-ral0001 --> nc-ral0001-wwp-311v 
  | --> nc-ral0001-to-ral0002-link 
  | 
  --> Ral Site2 (linked to Ral Site1) 
         | 
         -->Submap nc-ral0002 --> nc-ral0002-wwp-311v 
                              --> nc-ral0002-to-ral0001-link