Maps

From OpenNMS
Jump to: navigation, search

Map Availability in OpenNMS

In the OpenNMS 1.6.x series, maps are available for Internet Explorer only. If you wish to use maps on other platforms, the easiest way is to install Internet Explorer in wine.

As of OpenNMS 1.7.0, maps now work in most SVG-capable browsers.

Enabling

The maps are set to off by default in 1.6.x. In order to enable them navigate to the etc directory of your OpenNMS install.

  • In etc directory, rename the file map.disable to map.enable , this will in turn enable the map in the openNMS Web interface.
  • Go to http://<your server>:8980/opennms/Index.map and start creating your first own map!

In the 1.7.4 the maps are enabled by default. Just click on the link in the main menu to access the map.

  • if you want to disable maps rename in etc directory map.enable in map.disable
  • To access the map go to http://<your server>:8980/opennms/map/index.jsp

Links!

The maps will additionally show links between adjacent nodes, when the when linkd daemon is enable.

  • How-To Enable linkd to get links on nodes

Maps

Maps are also avalaible as a complete SVG client application.

Maps allow users to visualize nodes and relative links.

Maps can contain sub maps and nodes.

Maps gives an immediate representation of the status, severity and avalaibility of a map element throw a color.

To every map element is associated an icon. At the moment icons are automatically loaded using db asset field displaycategory.

Users in Admin Role can create, delete and modify maps.


The maps Configuration File

maps in OpenNMS is controlled by the map.properties file (located in the OpenNMS_Install_Path/etc directory).

Let's look at that file:

############################################################################
# map.properties
#--------------------------------------------------------------------------
# This file part defines client/server specific infos.
#
###########################################################################


###########################################################################
## S E V E R I T I E S    
###########################################################################

# A comma-separated list of severities.  A severity.{KEY}.id, 
# severity.{KEY}.color,
# severity.{KEY}.label,
# severity.{KEY}.flash default false
# property must be set for each key in this property.
# properties severity.default and severity.indeterminate are mandatory
# Severities must be ordered from worst to best (i.e.: critical.id < minor.id < normal.id, etc.)
# and must be a continous sequence of interger
#

severities=critical,major,minor,warning,normal,cleared,indeterminate

severity.critical.id=0
severity.critical.label=Critical
severity.critical.color=red
severity.critical.flash=true

severity.major.id=1
severity.major.label=Major
severity.major.color=orange


severity.minor.id=2
severity.minor.label=Minor
severity.minor.color=yellow

severity.warning.id=3
severity.warning.label=Warning
severity.warning.color=cyan

severity.normal.id=4
severity.normal.label=Normal
severity.normal.color=green

severity.cleared.id=5
severity.cleared.label=Cleared
severity.cleared.color=white

severity.indeterminate.id=6
severity.indeterminate.label=Indeterminate
severity.indeterminate.color=lightblue


severity.default=normal
severity.indeterminate=indeterminate

###########################################################################
## L I N K S
###########################################################################

# A comma-separated list of link keys.  
# link.{KEY}.id : identifies the link. If the linktypeid in datalinkinterface table is set the link type match is doing with this id.
# link.{KEY}.speed (optional): the speed in byte of the link - 
#                              It is used if linktypeid field is not set in datalinkinterface table 
#                              to check the parentnode and parentifindex in snmpinterface table
#                              together with snmptype.
#                              If snmpifSpeed and snmpIfType are the same setted then the link type
#                              is identified.
#                              The speed is displayed in Down Info Text Box if defined otherwise it is unknown.
# link.{KEY}.text: A brief text displayed in Down Info Text Box when you clieck on the Link that identifies the link type
# link.{KEY}.width : define the width of the link. Valid values are 1,2,3...
# link.{KEY}.dash-array (optional): define the outline style of the line. Valid values are 1,2,3... 
# link.{KEY}.snmptype (optional): the snmp if type see speed. It is used to identify the link!
# link.{KEY}.multilink.width (optional): define the width of the link if the link itself is a multi link
#                                        can be used to distinguish between links with multiple links or not
#                                        without setting there is no graphical difference with a single link
# link.{KEY}.multilink.dash-array (optional): define  the outline style of the line if the link itself is a multi link
#                                            can be used to distinguish between links with multiple links or not
#                                            without setting there is no graphical difference with a single link
#                                     
#
# Notice that you can specify more than 1 link with same snmptype, differing by speed


#property must be set for each key in this property.
links=ethernet,fastethernet,fastethernet2,gigaethernet,gigaethernet2,ieee80211,serial,framerelay,unknown,dwo,summary

link.ethernet.id=6
link.ethernet.text=Ethernet
link.ethernet.speed=10000000
link.ethernet.width=1
link.ethernet.snmptype=6

link.fastethernet.id=1
link.fastethernet.text= Fast Ethernet
link.fastethernet.speed=100000000
link.fastethernet.width=2
link.fastethernet.snmptype=62

link.fastethernet2.id=10
link.fastethernet2.text= Fast Ethernet
link.fastethernet2.speed=100000000
link.fastethernet2.width=2
link.fastethernet2.snmptype=6

link.gigaethernet.id=2
link.gigaethernet.text= GigaBit Ethernet
link.gigaethernet.speed=1000000000
link.gigaethernet.width=3
link.gigaethernet.snmptype=117

link.gigaethernet2.id=20
link.gigaethernet2.text= GigaBit Ethernet
link.gigaethernet2.speed=1000000000
link.gigaethernet2.width=3
link.gigaethernet2.snmptype=6

link.serial.id=3
link.serial.text= Serial Line
link.serial.speed=64000
link.serial.width=1
link.serial.dash-array=3
link.serial.snmptype=22


link.framerelay.id=4
link.framerelay.text= Frame Relay
link.framerelay.speed=64000
link.framerelay.width=1
link.framerelay.dash-array=5
link.framerelay.snmptype=32

link.ieee80211.id=5
link.ieee80211.text= WIFI
link.ieee80211.speed=100000000
link.ieee80211.width=2
link.ieee80211.dash-array=3
link.ieee80211.snmptype=71

link.unknown.id=9999
link.unknown.text= Unknown
link.unknown.width=1
link.unknown.dash-array=1

link.dwo.id=777
link.dwo.text= DWO Connection
link.dwo.width=1
link.dwo.dash-array=3

link.summary.id=1777
link.summary.text= SummaryLink
link.summary.width=3
#link.summary.dash-array=3

###########################################################################
## L I N K  D E F A U L T
###########################################################################
# the link information to be displayed when 
# the system is not able to identify the link type
# default set is unknown
link.default=9999

###########################################################################
## M U L T I L I N K  S T A T U S
###########################################################################
# max.links controls the max number of links to be displayed
# between two map element
#
# multilink.status controls which link should be displayed (if more then max.links)
# values for multilink.status are: ignore, best, worst
max.links=3
multilink.status=best

###########################################################################
## S U M M A R Y L I N K  
###########################################################################
# the link id to be displayed for a SUMMARYLINK
# default is the summary id
# the summary link colour is the colour of the summary link when
# different status colours are detected
summarylink.id = 1777
summarylink.color = yellow

###########################################################################
## L I N K  S T A T U S
###########################################################################
# A comma-separated list of linkstatuses keys.  
# linkstatus.{KEY}.color 
# linkstatus.{KEY}.flash (optional, default is false): if true, the link flashes

linkstatuses=up,down,admindown,testing,unknown,good,bad
linkstatus.up.color=green
linkstatus.good.color=green
linkstatus.down.flash=true
linkstatus.down.color=red
linkstatus.bad.color=red
linkstatus.bad.flash=true
linkstatus.admindown.color=blue
linkstatus.testing.color=orange
linkstatus.unknown.color=grey


###########################################################################
## N O D E  S T A T U S
###########################################################################

# A comma-separated list of statutes keys.  A status.{KEY}.id 
# status.{KEY}.uei and 
# status.{KEY}.color 
# status.{KEY}.text property must be set for each key in this property.
# Statuses must be ordered from worst to best (i.e.: nodedown.id < nodeup.id, etc.)

statuses=nodeup,nodedown,interfacedown,servicedown,linkdown,undefined

status.nodedown.id=0
status.nodedown.color=red
status.nodedown.uei=uei.opennms.org/nodes/nodeDown
status.nodedown.text=NodeDown

status.interfacedown.id=1
status.interfacedown.uei=uei.opennms.org/nodes/interfaceDown
status.interfacedown.color=orange
status.interfacedown.text=InterfaceDown

status.linkdown.id=2
status.linkdown.uei=uei.opennms.org/generic/traps/SNMP_Link_Down
status.linkdown.color=orange
status.linkdown.text=SNMPLinkDown

status.servicedown.id=3
status.servicedown.uei=uei.opennms.org/nodes/nodeLostService
status.servicedown.color=yellow
status.servicedown.text=NodeLostService

status.undefined.id=4
status.undefined.uei=MATCH_ALL_EVENTS
status.undefined.color=grey
status.undefined.text=SeeEventDetails

status.nodeup.id=5
status.nodeup.uei=uei.opennms.org/nodes/nodeUp
status.nodeup.color=green
status.nodeup.text=NodeUp

// status.default and status.unknown.uei are required values
// they should be equals to defined statuses
status.default=nodeup
status.unknown.uei=undefined

###########################################################################
## A V A I L
###########################################################################

# A comma-separated list of avails keys. 
# avail.{KEY}.id  
# avail.{KEY}.min  
# avail.{KEY}.color 
# avail.{KEY}.flash default false
#
# avail.undefined is mandatory

availabilities=normal,warning,critical,undefined

avail.normal.id=0
avail.normal.min=99
avail.normal.color=green

avail.warning.id=1
avail.warning.min=97
avail.warning.color=yellow

avail.critical.id=2
avail.critical.min=0
avail.critical.color=red
avail.critical.flash=true

# avail.undefined is mandatory
avail.undefined.id=3
avail.undefined.min=-1
avail.undefined.color=grey

# default is true
# setting to false speed up open and refresh map
avail.enable=true
#this field is mandatory
avail.enable.false.id=3



###########################################################################
## I C O N S    
###########################################################################
# A comma-separated list of incons keys. 
# icon.{KEY}.filename
icons=desktop,infrastructure,laptop,opennms,other,printer,server,telephony,unspecified,map,fileserver,firewall,mainframe,multilayerswitch,pix,router,switch,vax

// Use this for IE
#icon.desktop.filename=desktop.svg
#icon.infrastructure.filename=infrastructure.svg
#icon.laptop.filename=laptop.svg
#icon.opennms.filename=opennms.svg
#icon.other.filename=other.svg
#icon.printer.filename=printer.svg
#icon.server.filename=server.svg
#icon.telephony.filename=telephony.svg
#icon.unspecified.filename=unspecified.svg
#icon.map.filename=map.gif
#icon.fileserver.filename=fileserver.svg
#icon.firewall.filename=firewall.svg
#icon.mainframe.filename=mainframe.svg
#icon.multilayerswitch.filename=multilayerswitch.svg
#icon.pix.filename=pix.svg
#icon.router.filename=router.svg
#icon.switch.filename=switch.svg
#icon.vax.filename=vax.svg

icon.desktop.filename=png/desktop.png
icon.infrastructure.filename=png/infrastructure.png
icon.laptop.filename=png/laptop.png
icon.opennms.filename=png/opennms.png
icon.other.filename=png/other.png
icon.printer.filename=png/printer.png
icon.server.filename=png/server.png
icon.telephony.filename=png/telephony.png
icon.unspecified.filename=png/unspecified.png
icon.map.filename=map.gif
icon.fileserver.filename=png/fileserver.png
icon.firewall.filename=png/firewall.png
icon.mainframe.filename=png/mainframe.png
icon.multilayerswitch.filename=png/multilayerswitch.png
icon.pix.filename=png/pix.png
icon.router.filename=png/router.png
icon.switch.filename=png/switch.png
icon.vax.filename=png/vax.png


// icon.default.map and icon.default.node are required values
// they should be equals to defined icons
icon.default.map=map
icon.default.node=unspecified

// icon.default.mapelementdimension is not required can be set here
// uncomment the following object to set defaulElementSize to 20
// default now is 25 for Firefox best rendering.On IE 20 is suitable
# icon.default.mapelementdimension = 25

// use.semaphore is not required. Default is true.
// Uncomment the following line if you want to display icon inline color instead
// of displaying the default semaphore on bottom right of the icon.
#use.semaphore=false

###########################################################################
## SYSOIDS to ICONS   
###########################################################################
# A comma-separated list of sysoids keys. 
# sysoids.{KEY}.iconName
sysoids=.1.3.6.1.4.1.9.1.17,\
.1.3.6.1.4.1.9.1.48,\
.1.3.6.1.4.1.9.1.222,\
.1.3.6.1.4.1.9.1.278,\
.1.3.6.1.4.1.9.1.282,\
.1.3.6.1.4.1.9.1.283,\
.1.3.6.1.4.1.9.1.326,\
.1.3.6.1.4.1.9.1.359,\
.1.3.6.1.4.1.9.1.400,\
.1.3.6.1.4.1.9.1.451,\
.1.3.6.1.4.1.9.1.516,\
.1.3.6.1.4.1.9.1.543,\
.1.3.6.1.4.1.9.1.674,\
.1.3.6.1.4.1.9.1.863,\
.1.3.6.1.4.1.9.1.928,\
.1.3.6.1.4.1.9.5.40

sysoid..1.3.6.1.4.1.9.1.17.iconName=router
sysoid..1.3.6.1.4.1.9.1.48.iconName=router
sysoid..1.3.6.1.4.1.9.1.222.iconName=router
sysoid..1.3.6.1.4.1.9.1.278.iconName=switch
sysoid..1.3.6.1.4.1.9.1.282.iconName=multilayerswitch
sysoid..1.3.6.1.4.1.9.1.283.iconName=multilayerswitch
sysoid..1.3.6.1.4.1.9.1.326.iconName=router
sysoid..1.3.6.1.4.1.9.1.359.iconName=switch
sysoid..1.3.6.1.4.1.9.1.400.iconName=switch
sysoid..1.3.6.1.4.1.9.1.451.iconName=firewall
sysoid..1.3.6.1.4.1.9.1.516.iconName=switch
sysoid..1.3.6.1.4.1.9.1.543.iconName=telephony
sysoid..1.3.6.1.4.1.9.1.674.iconName=firewall
sysoid..1.3.6.1.4.1.9.1.863.iconName=router
sysoid..1.3.6.1.4.1.9.1.928.iconName=switch
sysoid..1.3.6.1.4.1.9.5.40.iconName=switch

###########################################################################
## B A C K G R O U N D   I M A G E S    
###########################################################################
# A comma-separated list of bgimages keys. 
# bgimages.{KEY}.filename
bgimages=napoli,italia,abruzzo,basilicata,calabria,campania,emilia_romagna,friuli,lazio,liguria,lombardia,molise,marche,piemonte,puglia,sicilia,sardegna,trentino,toscana,umbria,united_states_unlabeled,valle_d_aosta,veneto

bgimage.napoli.filename=napoli.gif
bgimage.italia.filename=italia.jpg
bgimage.abruzzo.filename=abruzzo.jpg
bgimage.basilicata.filename=basilicata.jpg
bgimage.calabria.filename=calabria.jpg
bgimage.campania.filename=campania.jpg
bgimage.emilia_romagna.filename=emilia_romagna.jpg
bgimage.friuli.filename=friuli.jpg
bgimage.lazio.filename=lazio.jpg
bgimage.liguria.filename=liguria.jpg
bgimage.lombardia.filename=lombardia.jpg
bgimage.molise.filename=molise.jpg
bgimage.marche.filename=marche.jpg
bgimage.piemonte.filename=piemonte.jpg
bgimage.puglia.filename=puglia.jpg
bgimage.sicilia.filename=sicilia.jpg
bgimage.sardegna.filename=sardegna.jpg
bgimage.trentino.filename=trentino.jpg
bgimage.toscana.filename=toscana.jpg
bgimage.umbria.filename=umbria.jpg
bgimage.united_states_unlabeled.filename=united_states_unlabeled.jpg
bgimage.valle_d_aosta.filename=valle_d_aosta.jpg
bgimage.veneto.filename=veneto.jpg

###########################################################################
## B A C K G R O U N D   I M A G E   C R E D I T S
###########################################################################
# Source citations for background images
bgimage.united_states_unlabeled.citation=National Atlas of the United States, March 5, 2003, http://nationalatlas.gov

############################################################################
## C O N T E X T  M E N U
#
############################################################################
# 	- A comma-separated list of context menu commands (skipped if contextmenu is disabled):
# 		cmenu.commands=COMMAND1,COMMAND2,...,COMMANDN 
# 		for each command:
#		cmenu.{COMMAND1}.link: link to the page to open (you can use the special words 'ELEMENT_ID' and 'ELEMENT_LABEL'
# 											 to use the selected map element's id or label as argument of the linked page)
#       also added the ELEMENT_HOSTNAME that is the hostname of the node
#       and ELEMENT_IP that is the suitable ip address for the node
#		cmenu.{COMMAND1}.params: (javascript window.open() ) params for the window containing the page
#		- to insert a separator in the context menu, use the character '-' as command and omit link and params.
#		- link is a parameter mandatory, params is optional


############################################################################
# Add context menu item here
# uncomment this to enable 'telnet' in context menu
#cmenu.commands=Telnet,Ping,Traceroute,-,Node%20Page,Alarms,Events,Resource%20Graphs
# comment this if you want to enable 'telnet' item in context menu
cmenu.commands=Ping,Traceroute,-,Node%20Page,Alarms,Events,Resource%20Graphs
# Context menu node Item
cmenu.Node%20Page.link=element/node.jsp?node=ELEMENT_ID
cmenu.Node%20Page.params=toolbar,width=1280,height=800, left=0, top=0, scrollbars=1, resizable=1
# Context Menu Telnet Item, uncomment to enable Telnet from map context menu
#cmenu.Telnet.link=telnet://ELEMENT_HOSTNAME
#cmenu.Telnet.link=telnet://ELEMENT_IP
cmenu.Ping.link=map/response/ping.jsp?node=ELEMENT_ID
# use this on solaris
#cmenu.Ping.link=map/response/ping.jsp?node=ELEMENT_ID&solaris=true
cmenu.Ping.params=toolbar,width=300,height=300, left=0, top=0, scrollbars=1, resizable=1
cmenu.Traceroute.link=map/response/traceroute.jsp?node=ELEMENT_ID
cmenu.Traceroute.params=toolbar,width=300,height=300, left=0, top=0, scrollbars=1, resizable=1
cmenu.Alarms.link=alarm/list.htm?sortby=id&acktype=unack&limit=20&filter=node%3DELEMENT_ID
cmenu.Alarms.params=toolbar,width=1280,height=800, left=0, top=0, scrollbars=1, resizable=1
cmenu.Events.link=event/list?filter=node%3DELEMENT_ID
cmenu.Events.params=toolbar,width=1280,height=800, left=0, top=0, scrollbars=1, resizable=1
cmenu.Resource%20Graphs.link=graph/chooseresource.htm?parentResourceType=node&parentResource=ELEMENT_ID&reports=all
cmenu.Resource%20Graphs.params=toolbar,width=1280,height=800, left=0, top=0, scrollbars=1, resizable=1

# Also, you can define the way to calculate severity for (sub)Maps.
# property 'severity.map' may be 
#	-'worst': gets the worst severity of the elements of the map
#	-'avg':   calculates the severity of the map as the average severity of all the elements of the map
#	-'best':  gets the best severity of the elements of the map
# default value='avg'

severity.map=worst

#	- enable.reload: if true, reload map instead of refresh (default is false)
#			 reload should be actived for map's implementations in which the content of a map
#			 (elements in addition to status and links) could change in the time. 			
#	- enable.contextmenu: if false, disable context menu for node elements (default is true)
#	- enable.doubleclick: if false, disable double click for node elements (default is true)

enable.reload=false
enable.contextmenu=true
enable.doubleclick=true

This file defines severity, status and avalaibility visualization properties and parameters for map elements. You can change the default settings (similar to OpenNMS standard severity and event configuration) to meet your requirement.

Beginning with release 1.7.4 the following section has been added to the map.properties file.

###########################################################################
## SYSOIDS to ICONS
###########################################################################
# A comma-separated list of sysoids keys.
# sysoids.{KEY}.iconName
sysoids=.1.3.6.1.4.1.9.1.17,\
.1.3.6.1.4.1.9.1.48,\
.1.3.6.1.4.1.9.1.222,\
.1.3.6.1.4.1.9.1.278,\
.1.3.6.1.4.1.9.1.282,\
.1.3.6.1.4.1.9.1.283,\
.1.3.6.1.4.1.9.1.326,\
.1.3.6.1.4.1.9.1.359,\
.1.3.6.1.4.1.9.1.400,\
.1.3.6.1.4.1.9.1.451,\
.1.3.6.1.4.1.9.1.516,\
.1.3.6.1.4.1.9.1.543,\
.1.3.6.1.4.1.9.1.674,\
.1.3.6.1.4.1.9.1.863,\
.1.3.6.1.4.1.9.1.928,\
.1.3.6.1.4.1.9.5.40

sysoid..1.3.6.1.4.1.9.1.17.iconName=router
sysoid..1.3.6.1.4.1.9.1.48.iconName=router
sysoid..1.3.6.1.4.1.9.1.222.iconName=router
sysoid..1.3.6.1.4.1.9.1.278.iconName=switch
sysoid..1.3.6.1.4.1.9.1.282.iconName=multilayerswitch
sysoid..1.3.6.1.4.1.9.1.283.iconName=multilayerswitch
sysoid..1.3.6.1.4.1.9.1.326.iconName=router
sysoid..1.3.6.1.4.1.9.1.359.iconName=switch
sysoid..1.3.6.1.4.1.9.1.400.iconName=switch
sysoid..1.3.6.1.4.1.9.1.451.iconName=firewall
sysoid..1.3.6.1.4.1.9.1.516.iconName=switch
sysoid..1.3.6.1.4.1.9.1.543.iconName=telephony
sysoid..1.3.6.1.4.1.9.1.674.iconName=firewall
sysoid..1.3.6.1.4.1.9.1.863.iconName=router
sysoid..1.3.6.1.4.1.9.1.928.iconName=switch
sysoid..1.3.6.1.4.1.9.5.40.iconName=switch

This allows you to define icons for map elements based on each element's sysoid. Icons for a few cisco devices are defined in the distribution, as shown above. You may make additions and changes to meet your specific needs. When a new map is generated, these icons will be used instead of the generic default icon for all elements with matching entries. The generic default icon will be still used for any element without a matching entry. If you wish to change the icon for a specific element once a map has been created, you may do so using the map's menus.

Here an example map screenshot: Example.jpg

Changing map Style

It is possible to customize map layout. This means that the user is able to change the text size, the default font and the colors for every element of the map. These configurations are holded in javascript variables. So changing these javascript variables let the user customize the map layout. In such a way you can customize Tooltip, ContextMenu, Menu etc etc. For this scope all these variables are put in the same file "ApplicationVariables" under map/svgjavascript directory. Here is the default configuration.

// The suffix to be used in URLs in mapDisplatcher-servlet.xml
var suffix = "map";

// IMAGES FOLDERS
var IMAGES_FOLDER = "images";
var IMAGES_BACKGROUND_FOLDER = IMAGES_FOLDER+"/background/";
var IMAGES_ELEMENTS_FOLDER = IMAGES_FOLDER+"/elements/";


// General Variables used for fonts setting
var titleFontSize = 12;
var textFontSize = 10;
var textFamily = "Arial,Helvetica";

// Variables used by "Link" SVG Object 
var deltaLink=6;
var borderPercentage=5;

// Variables used by "Summary Link" SVG Object
var summaryLinkId = -1;
var summaryLinkColor;
//global factors for spacing between elements
//suggested factor:   xfactor/yfactor = 4/3 
var X_FACTOR = 3.5;
var Y_FACTOR = 2.625;

//TabGroup Object Style
var tabStyles = {"fill":"navy","stroke":"navy","stroke-width":1,"cursor":"pointer"};
var tabtextStyles = {"font-family":textFamily,"font-size":titleFontSize,"fill":"white","font-weight":"normal"};
var tabactivetabBGColor = "blue";
var tabwidth=200;

// Menu ObjectStyle
//Variables used for Menu style
var menuDownColor = "blue";
var menuUpColor =  "black";
var menuStyle = {"stroke":"navy","fill":"black","stroke-width":1};
var menuTextStyle = {"font-size": titleFontSize,"font-family":textFamily,"fill":"white"};
var menuMouseStyle = {"fill":"green","fill-opacity":0};
var menuWidth = 90;
var menuHeight = 20;
var mapMenuX = 0;
var mapMenuY = 21;
var nodeMenuX= menuWidth;
var nodeMenuY= mapMenuY;
var viewMenuX= menuWidth;
var viewMenuY = mapMenuY;
var refreshMenuX = 2 * menuWidth;
var refreshMenuY = mapMenuY;
var menuDeltaX = 0;
var menuDeltaY = menuHeight;

// These are variables used to set <button> object style
var buttonx = 180;
var buttony = 0;
var buttonwidth = 60;
var buttonheight = 20;
var buttonTextStyles = {"font-family":textFamily, "fill":"white","font-size":titleFontSize};
var buttonStyles = {"fill":"blue","fill-opacity":0};
var shadeLightStyles = {"fill":"blue","stroke":"pink","stroke-width":1,"fill-opacity":0.5,"stroke-opacity":0.9};
var shadeDarkStyles = {"fill":"blue","stroke":"pink","stroke-width":1,"fill-opacity":0.5,"stroke-opacity":0.9};
var shadowOffset = 0;

// These are variables used to set <textbox> object style
var textboxmaxChars = 32;
var textboxx = 2; 
var textboxy = 0; 
var textboxWidth = 170;
var textboxHeight = 20;
var textYOffset = 14;
var textStyles = {"font-family":textFamily,"font-size":titleFontSize,"fill":"black"};
var boxStyles = {"fill":"white","stroke":"pink","stroke-width":1,"fill-opacity":0.5,"stroke-opacity":0.9};
var cursorStyles = {"stroke":"dimgray","stroke-width":1.5};
var seltextBoxStyles = {"fill":"white","stroke":"pink","stroke-width":1,"fill-opacity":0.5,"stroke-opacity":0.9};

// These are variables used to set <Selection Box> object style
var selBoxwidth = 238;
var selBoxxOffset =2;
var selBoxyOffset = 23;
var selBoxCellHeight = 18;
var selBoxTextpadding = 3;
var selBoxheightNrElements=5;
var selBoxtextStyles = {"font-family":textFamily,"font-size":titleFontSize,"fill":"dimgray"};
var selBoxStyles = {"stroke":"dimgray","stroke-width":1,"fill":"white"};
var selBoxScrollbarStyles = {"stroke":"dimgray","stroke-width":1,"fill":"whitesmoke"};
var selBoxSmallrectStyles = {"stroke":"dimgray","stroke-width":1,"fill":"lightgray"};
var selBoxHighlightStyles = {"fill":"dimgray","fill-opacity":0.3};
var selBoxTriangleStyles = {"fill":"dimgray"}; 
var selBoxpreSelect = 0;

// These are variables to set <ContextMenu> object style
var cmheight;
var cmdelta= 30;
var cmwidth = 200;
var cmsubwidth = 150;

var cmmenuStyle={"stroke":"dimgray","stroke-width":1,"fill":"mintcream"};
var cmmenuElementStyle = {"fill":"mintcream", "fill-opacity":1.0};
var cmmenuElementTextStyle={"font-size": 16,"font-family":"Times","fill":"black"};
var cmmenuBarStyle={"stroke":"dimgray","stroke-width":0.5};
var cmmenuElementMouseStyle={"fill":"blue"};

// These are variables to set <ToolTip> object style
var tooltipTextStyles = {"font-family":"Arial,Helvetica","fill":"dimgray","font-size":titleFontSize};
var tooltipRectStyles = {"fill":"white","stroke":"dimgray"};


//********* Variables to Manage Application ************

//say if the menu is been opened or not
//color of the component of the menu
// The SVG node for menu in Map.svg
var menuSvgElement;
// The SVG Node for MapPanel in Map.svg
var mapSvgElement;
// The SVG Node for TabPanel in Map.svg
var tabSvgElement;
//the SVG map object to work on.
var map;
//The SVG tabGroup object to work on.
var mapTabGroub;

// The Javascript var Object for menus!
var mapMenu;
var nodeMenu;
var viewMenu;
var refreshMenu;

// Global variables/constants identify the menus object
var mapMenuId = "MapMenu";
var nodeMenuId = "NodeMenu";
var viewMenuId = "ViewMenu";
var refreshMenuId = "RefreshMenu";

// Needed by ECMAScripts
var myMapApp = new mapApp(false,undefined);

// Windows Objects used now when double click on MapElements
myMapApp.Windows = new Array();

//WorkPanel data
var workPanelWidth = 3*menuWidth;
var workPanelHeight = 600;
var workPanelDelta = 2;

// The Map width and height definition
var mapWidth;
var mapHeight;

//string containing a string form of the current map saved. this is used to test if the map is changed
var savedMapString=new String(); 

// variable for setting refresh time
var refreshNodesIntervalInSec=300; 

// variable for setting element dimension
var mapElemDimension=25;	

// Variable that states the current mode of the map. If true the user can modify the maps
var isAdminMode = false;
	
// int containing the number of loading at the moment (it is increased when an httprequest is done until handled) 
var loading=0;

// Variables used to define the state of the map aplication
var refreshingMapElems=false;
var deletingMapElem=false;
var addingMapElemNeighbors=false;
var settingMapElemIcon=false;
var stopCountdown=false;
var countdownStarted=false;
// ************ TopInfo variables ************

// Variable used to identify a Button SVG Object in TopInfo SVG box
var button1;
 
// Variable used to identify a TextBox SVG Object in TopInfo SVG box
var textbox1;

// *********** Variables used by selectionList SVG Object in TopInfo SVG box ******

// variables for NODE --- nodes are loaded by LoadNodes()
var selectedMapElemInList=0;
var selNodes; 

var nodeLabels = [" "];
var nodeSortAss;
var nodeidSortAss;
var mynodesResult;
var nodesLoaded = false;

//variables for Hide NODE
var hideNodesIds = "";
var hasHideNodes = false;

// variables for MAP ---maps are loaded by LoadMaps()
var mapLabels = [" "];
var mapSortAss;
var mapidSortAss;
var mymapsResult;		
var mapsLoaded = false;
//variables for tabGroup
var mapTabTitles = new Array();
// variables for search Map
var nodeLabelMap =new Array();

// variable to support the default map
var defaultMap;

//variables for Hide Maps
var hideMapsIds = "";
var hasHideMaps = false;

// variables for CATEGORIES --- categories are loaded by init()
var selectedCategoryInList=0;
var selCategories; 

var categories = [" "];
var categorySorts = [null]; 
var categorySortAss;
var mycategoriesResult;
	
//variables for MAP BACKGROUND IMAGES ---- backgroun image are laoded by init()
var selectedBGImageInList=0;
var selBGImages; 

var BGImages=[""];
var BGImagesSorts=[null]; 
var BGImagesSortAss;
var myBGImagesResult;

//variables for ICONS
var selectedMEIconInList=0;
var selMEIcons;
 
var MEIcons=[""];
var MEIconsSorts=[null]; 
var MEIconsSortAss;
var myMEIconsResult;		


//variables for NODE DIMENSION --- setted by init()
var selectedMapElemDimInList;
var selMapElemDim; 

var MapElemDim = [""];
var MapElemDimSorts = [null]; 
var MapElemDimSortAss;
var myMapElemDimResult;

// variable for setting refresh time --- setted in init()
var selectedRefreshTimeList="30 seconds";
var selRefreshTimeMins;

var refreshTimeMins = [""];
var refreshTimeMinsSorts= [null];
var refreshTimeMinsSortAss;
var myRefreshTimeMinsResult;		

//********* Finished TopInfo variables ***********

// ********Variables set during application init **************

// variable that stores if the user is Admin Role.
var isUserAdmin;

// variable to display semaphore or icon inline color
var useSemaphore;

// Define known statuses
var STATUSES_TEXT= new Array();
var STATUSES_COLOR= new Array();
var STATUSES_UEI= new Array();

// Define known severities
var SEVERITIES_LABEL= new Array();
var SEVERITIES_COLOR= new Array();
var SEVERITIES_FLASH= new Array();

// Define known avails
var AVAIL_COLOR = new Array();
var AVAIL_MIN = new Array();
var AVAIL_FLASH= new Array();

// Define known links
var LINK_SPEED = new Array();
var LINK_TEXT = new Array();
var LINK_WIDTH = new Array();
var LINK_DASHARRAY = new Array();	
var MULTILINK_WIDTH = new Array();
var MULTILINK_DASHARRAY = new Array();	
var LINKSTATUS_COLOR = new Array();	
var LINKSTATUS_FLASH = new Array();	

// Context Menu 
var CM_COMMANDS = new Array();
var CM_LINKS = new Array();
var CM_PARAMS = new Array();

// Global Variables for defaults  
var DEFAULT_ICON;
var DEFAULT_MAP_ICON;
var DEFAULT_BG_COLOR;

// Global variable to define the color of semaphore
var colorSemaphoreBy='S';

// Variable for the map history
var mapHistory = new Array();
var mapHistoryName = new Array();
var mapHistoryIndex = 0;

// a currentMapId = MAP_NOT_OPENED indicates that no Maps are opened. 
// current map variables
var currentMapId;
var currentMapBackGround="";
var currentMapAccess="", currentMapName="", currentMapOwner="", currentMapUserlast="", currentMapCreatetime="", currentMapLastmodtime="", currentMapType="";

//vars for set background color
var x_picker,pick_begin,pick_color,pick_appui,comp_rouge=128,comp_vert=128,comp_bleu=128,pick_prefixe="pickColor",node,cible;
	
// Max number of links between two mapElements
var maxLinks;

The file is commented so that is easy to made changes. Happy Map Refactoring!

ACL

  • It is possible to restrict access to the maps by specifing user and group with access schema.
  • The access schema supported are RW, RO and RWRO
  • RW and RO at the moment are equivalent. If the access is set to one of this every user can access the map.
  These access schema were designed to gain access to the map to the user in ReadWrite mode or ReadOnly mode
   but was never implemented.
  • RWRO enables access to the map only to owner and to the map group specified
  • At the moment only user that have ADMIN_ROLE can modify maps for which the specified user has access
  • When you create a map using the map application you create a map whose owner is the user who creates the map
  (that must have ADMIN_ROLE) whise group is null and whose access schema RW (so every user can access the map)
  • There is no way at the moment to change owner, group and access schema frm the Map GUI
  • To change the map access go to the database and update map table:
  owner is in the map table field mapOwner
  group is in the map table field mapGroup
  access schema is in the map table field mapAccess

Automatic maps

  • From version 1.7.2 it is possible to automatically generate maps using the maps-provisiong-adapter.
  • In the map provisiong adapter you can specify the ACL for the map so that are created with proper access control


Default map for group

  • From version 1.7.4 it is possible to set a default map for a group in modifyGroup page. When a user that belongs to a group for which the default map is specified log into

the map application the default map is automatically open.

JSON

  • From version 1.7.10 JSON is used for communication between ajax client and the application server


Reload map.properties file

  • From version 1.7.11 it is possible reload the map.proeprties file without restarting opennms. Just go into Admin Mode and Select the Config Menu Item on Reload Menu to Reload configuration. This is very useful to customize the map layout or when adding statutes icons and backgrounds.


Anonymous map access

File: /usr/share/opennms/jetty-webapps/opennms/WEB-INF/applicationContext-spring-security.xml
<!-- Anonymous map access -->
    <intercept-url pattern="/map/**" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_DASHBOARD"/>
    <intercept-url pattern="/*.map" access="ROLE_ANONYMOUS,ROLE_USER,ROLE_DASHBOARD"/>

Links

Enhancements

  • Improve performance in loading and refresh function. It seems that the best way of doing this is to work using asyncronus methods. This must be developed using new service mapd.
  • Use Daos
  • Use RESTful services for maps