Object Map Visualization

Table of Contents

This page explains how Object Map visualization can be implemented using RapidOSS with OpenNMS plugin.

In order to meet the needs of visualizing an object map between Node, Interface and Services in OpenNMS, the following steps are followed:

1. Modify mapConfiguration.groovy in RS_HOME/RapidSuite/scripts folder to include new mapType (ex: "opennms"). OpenNmsObject model and RsMapConnection model are used for node and connection information respectively.

def getConfiguration(mapType)
{
    CONFIG=[:]
    if(!mapType)
    {
        .
	.
	.
    }
    else if(mapType=="opennms")
    {

        CONFIG.DEFAULT_NODE_MODEL="OpenNmsObject";
        CONFIG.USE_DEFAULT_NODE_MODEL=true; //if false, nodeModel will be extracted from node name parameters
        CONFIG.NODE_PROPERTY_MAPPING=["displayName":"displayName","type":"className"];

        CONFIG.USE_MAP_TYPE=true;  //if true search query will have mapType:"mapType" appended
        CONFIG.DEFAULT_MAP_TYPE="default"; //used if mapType is not passed as a parameter to script

        CONFIG.DEFAULT_CONNECTION_MODEL="RsMapConnection";
        CONFIG.CONNECTION_SOURCE_PROPERTY="a_Name";
        CONFIG.CONNECTION_TARGET_PROPERTY="z_Name";
        CONFIG.CONNECTION_SOURCE_CLASS_PROPERTY="a_RsClassName";
        CONFIG.CONNECTION_TARGET_CLASS_PROPERTY="z_RsClassName";
    }
    else
    {
	.
	.
	.
    }
    return CONFIG;
}

2. Modify inventory connector (openNmsInventory.groovy in RS_HOME/RapidSuite/scripts folder) to establish the connections between different nodes in the graph while instances are added to the related models. In other words, first define the map structure (ex: node relations are between NodeObject to InterfaceObject to ServiceObject), and then for every object pair (nodes in the graph), call RsMapConnection.add() to add connection instances to be displayed in the map later.

Below two lines are added in proper places in the connector script.

RsMapConnection.add(name:"${nodeObj.name}_${ipInterfaceObj.name}",mapType:"opennms",a_Name:nodeObj.name,z_Name:ipInterfaceObj.name);
RsMapConnection.add(name:"${ipInterfaceObj.name}_${ifServiceObj.name}",mapType:"opennms",a_Name:ipInterfaceObj.name,z_Name:ifServiceObj.name);

3. Modify redirectToMap.gsp in RS_HOME/RapidSuite/web folder to handle "opennms" map type when map related menu items are selected from the operations console UI.

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
    <head>
    <%
        def rsClassName=params.rsClassName?params.rsClassName:"";
        def mapType=params.mapType?params.mapType:"";

        def objectName = params.name;
        def relatedObject = objectName;
        def object = RsTopologyObject.get(name:objectName);
        if(object instanceof RsLink){
           relatedObject = object.a_ComputerSystemName; 
        }
// ADDED TO HANDLE opennms MAPTYPE
        else if(object instanceof OpenNmsObject) 
        {
            mapType="opennms";
        }
      
        response.sendRedirect(URLUtils.createURL("index/maps.gsp", name:relatedObject,rsClassName:rsClassName,mapType:mapType]))
    %>
     </head>
</html>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Anonymous says:

You are not logged in. Any changes you make will be marked as anonymous.