Map configuration format description

General Information

The NagVis configuration file format is very similiar to the format used by Nagios(TM).

Configuration statements start with the keyword "define" followed by a type field and a left curly bracket ({). Every following line defines variable-value pairs, separated by a ( = ) until a right curly bracket (}) is found.

Hashes (#) are used to mark comments, note that a comment line MUST start with a hash not with other chars like whitespaces!

Object types

Description of the object types

Global

The first definition in every config file should be of the special type "global". Options which are defined at this paragraph are valid for the whole map and are getting inherited to other types defined later.

Example with all options which have to be set:

define global {
 allowed_user=EVERYONE
 allowed_for_config=nagiosadmin
 map_image=lan.png
}
Value Default Description
allowed_for_config Comma separated list of Nagios users who are allowed to edit this map. Can be "EVERYONE" for no permission check.
allowed_user Comma separated list of Nagios users who are allowed to view this map. Can be "EVERYONE" for no permission check.
map_image The name of the map image displayed in the background of the NagVis map, for example a Visio (TM) drawing. New in 1.4: The value can even be "none" or empty for no background image.
alias map name The alias is the label for each map. If it is defined it is shown everywhere in NagVis frontend and WUI
backend_id inherited (nagvis.ini.php) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend defined as "defaultbackend" at the Main Configuration file is used.
background_color inherited (nagvis.ini.php) Background color of this map. If this is not set backgroundcolor from Main Configuration file is taken.
context_menu inherited (nagvis.ini.php) Enable/Disable the context menu on your map objects. (New in 1.4)
context_templateinherited (nagvis.ini.php)Default context template to be used on this map (New in 1.4)
event_backgroundinherited (nagvis.ini.php)Enable/Disable changing background color on state changes (Configured color is shown when summary state is PENDING, OK or UP). (New in 1.4)
event_highlightinherited (nagvis.ini.php)Enable/Disable highlighting of the state changing object by adding a flashing border. (New in 1.4)
event_highlight_durationinherited (nagvis.ini.php)Set the highlight duration in miliseconds (New in 1.4.1)
event_highlight_intervalinherited (nagvis.ini.php)Set the highlight interval in miliseconds (New in 1.4.1)
event_loginherited (nagvis.ini.php)Enable/Disable the eventlog in the new javascript frontend. The eventlog keeps track of important actions and information. (New in 1.4)
event_log_levelinherited (nagvis.ini.php)Loglevel of the eventlog (Available: debug, info, warning, critical). (New in 1.4)
event_log_heightinherited (nagvis.ini.php)Height of the javascript eventlog in px (New in 1.4)
event_log_hiddeninherited (nagvis.ini.php)Hide/Show the eventlog on map loading (New in 1.4)
event_scrollinherited (nagvis.ini.php)Enable/Disable scrolling to the icon which changed the state when the icon is out of the visible scope. (New in 1.4)
event_soundinherited (nagvis.ini.php)Enable/Disable sound signals on state changes. (New in 1.4)
header_menu inherited (nagvis.ini.php) Enable/Disable the header menu
header_template inherited (nagvis.ini.php) header template to be used on ths map
hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
hover_template inherited (nagvis.ini.php) Default hover template to be used on this map
hover_timeout inherited (nagvis.ini.php) Default hover menu ajax request timeout in seconds (Deprecated in 1.4)
hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
iconset inherited (nagvis.ini.php) Iconset to use as default for all objects placed on the map. Can be overwritten on a per object base.
In the example "std_small" is used which means an OK state will be displayed using "std_small_ok.png", a CRITICAL state will be displayed by using "std_small_critical.png" and so on.
in_maintenance 0 Enable/Disable the maintenance mode of this map. If a map is in maintenance mode only a message gets displayed instead of the map.
label_show 0 Enable/Disable labels for the maps objects
label_x -20 Default x-position of the labels in px (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y +20 Default y-position of the labels in px (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_width auto Default width of the labels in px
label_background transparent Default background color of the labels. The color should be given in hexcode. Can also be "transparent".
label_border #000000 Default border color of the labels. The color should be given in hexcode. Can also be "transparent".
only_hard_states inherited (nagvis.ini.php) Sets whether soft states should be ignored. Default setting is 0.
recognize_services inherited (nagvis.ini.php) Sets whether the states of the services on hosts, hostgroup objects should be recognized. If this is not given in the config it's set to 1.
show_in_lists inherited (nagvis.ini.php) Show the maps in lists (dropdowns, index page, ...)
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
usegdlibs inherited (nagvis.ini.php) Activates the usage of GD-Libs on this map (lines can only be used if GD-Libs are activated) (Deprecated in 1.4)

Host

Example with all options which have to be set (note that options already defined in the global section are optional):

define host {
 host_name=localhost
 x=100
 y=200
}
Value Default Description
host_name Name of the host as defined in Nagios
x X axis coordinate
y Y axis coordinate
backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object. (New in 1.4)
context_templateinherited (nagvis.ini.php)Context template for this object. (New in 1.4)
hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
hover_template inherited (global) Hover template for this object
hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
[host_name]: This macro stands for the object name.
hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
hover_childs_limit inherited (nagvis.ini.php) Maximum number of children to be displayed. Set to -1 to disable the limit.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
label_show inherited (global) Enable/Disable label for this object
label_text [name] Text of the label. Available macros: [name], [alias], [output]
label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_width inherited (global) Width of the label in px
label_background inherited (global) Background color of the label. The color should be given in hexcode. Can also be "transparent".
label_border inherited (global) Border color of the labels. The color should be given in hexcode. Can also be "transparent".
line_type Specifies the type of line when view_type=line. Valid values are "11" for lines with one arrow at the end of a line and "10" for lines with two arrows pointing to each other in the middle of the line.
line_width 3 This defines the width of the line when this object is being displayed as line.
only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
recognize_services inherited (global) Defines if the services of the host affect the displayed state. If set to "1" a critical service on the host will result in a host state display as critical too. If set to "0" only the Nagios Host State (UP or DOWN) will be used and the services of the host will be ignored.
url URL where the Icon should link to. Default link is to the Nagios CGIs. Macros [host_name], [htmlcgi] and [htmlbase] are available. New in 1.4: The value can be empty to disable the link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Macro [name] is available.
use Comma separated list of object templates to use. For details see template objects
view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines. (New in 1.4)
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1.

Service

Example with all options which have to be set (note that option already defined in the global section are optional):

define service {
 host_name=localhost
 service_description=ping
 iconset=std_big
 x=100
 y=200
}
Value Default Description
host_name Name of the host as defined in Nagios
service_description Name of the service as defined in Nagios
x X axis coordinate
y Y axis coordinate
backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object. (New in 1.4)
context_templateinherited (nagvis.ini.php)Context template for this object. (New in 1.4)
gadget_url The value can be a gadget script in gadget path (nagvis/gadgets) e.g. "std_speedometer.php" or a full URI to a gadget like script surrounded by brackets e.g. "[http://127.0.0.1/nagios/nagvis/gadgets/std_speedometer.php]". For details about gadgets see here. This option is only recognized when view_type="gadget" is set. (New in 1.4)
gadget_scale 100 The scale of the gadget. Default scale is 100 (percent). The gadgets should be able to be resized by this parameter (New in 1.4.2)
gadget_opts Optional gadget specific params. The contents can be freely defined for each gadget. The value is processed as GET param "opts". We recommend to use a var/val format like this: key1=val1,key2=val2. Then you can easily split this string to an array in the gadget. (New in 1.4.4)
hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
hover_template inherited (global) Hover template for this object
hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
[host_name]: This macro stands for the object name.
[service_description]: This macro stands for the service description and will only be replaced in service objects.
hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
hover_childs_limit inherited (nagvis.ini.php) Maximum number of children to be displayed. Set to -1 to disable the limit.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
label_show inherited (global) Enable/Disable label for this object
label_text [name] [service_description] Text of the label. Available macros: [name], [alias], [service_description], [output]
label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_width inherited (global) Width of the label in px
label_background inherited (global) Background color of the label. The color should be given in hexcode. Can also be "transparent".
label_border inherited (global) Border color of the labels. The color should be given in hexcode. Can also be "transparent".
line_type Specifies the type of line when view_type=line. Valid values are "11" for lines with one arrow at the end of a line and "10" for lines with two arrows pointing to each other in the middle of the line.
line_width 3 This defines the width of the line when this object is being displayed as line.
only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
url URL where the Icon should link to. Default link is to the Nagios CGIs. Available macros: [host_name], [service_description], [htmlcgi] and [htmlbase]. New in 1.4: The value can be empty to disable the link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name], [service_description],
use Comma separated list of object templates to use. For details see template objects
view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines. (New in 1.4)
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1.

Hostgroup

Example with all options which have to be set (note that options already defined in the global section are optional):

define hostgroup {
 hostgroup_name=servers
 x=100
 y=200
}
Value Default Description
hostgroup_name Name of the hostgroup as defined in Nagios
x X axis coordinate
y Y axis coordinate
backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object. (New in 1.4)
context_templateinherited (nagvis.ini.php)Context template for this object. (New in 1.4)
hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
hover_template inherited (global) Hover template for this object
hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
[hostgroup_name]: This macro stands for the object name.
hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
hover_childs_limit inherited (nagvis.ini.php) Maximum number of children to be displayed. Set to -1 to disable the limit.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
label_show inherited (global) Enable/Disable label for this object
label_text [name] Text of the label. Available macros: [name], [alias], [output]
label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_width inherited (global) Width of the label in px
label_background inherited (global) Background color of the label. The color should be given in hexcode. Can also be "transparent".
label_border inherited (global) Border color of the labels. The color should be given in hexcode. Can also be "transparent".
line_type Specifies the type of line when view_type=line. Valid values are "11" for lines with one arrow at the end of a line and "10" for lines with two arrows pointing to each other in the middle of the line.
line_width 3 This defines the width of the line when this object is being displayed as line.
only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
recognize_services inherited (global) Defines if the services of the hosts affect the displayed state. If set to "1" a critical service on one of the host will result in a hostgroup state display as critical too. If set to "0" only the Nagios Host State (UP or DOWN) will be used and the services of the hosts will be ignored.
url URL where the Icon should link to. Default link is to the Nagios CGIs. Available macros: [hostgroup_name], [htmlcgi] and [htmlbase]. New in 1.4: The value can be empty to disable the link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name]
use Comma separated list of object templates to use. For details see template objects
view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines. (New in 1.4)
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1.

Servicegroup

Example with all options which have to be set (note that options already defined in the global section are optional):

define servicegroup {
 servicegroup_name=servicegroup1
 x=100
 y=200
}
Value Default Description
servicegroup_name Name of the servicegroup as defined in Nagios.
x X axis coordinate
y Y axis coordinate
backend_id inherited (global) Backend-ID defined in Main Configuration file where NagVis should search for the object states. If this parameter is not given, the Backend which was set in global section of the map is taken.
context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object. (New in 1.4)
context_templateinherited (nagvis.ini.php)Context template for this object. (New in 1.4)
hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
[servicegroup_name]: This macro stands for the object name.
hover_template inherited (global) Hover template for this object
hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
label_show inherited (global) Enable/Disable label for this object
label_text [name] Text of the label. Available macros: [name], [alias], [output]
label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_width inherited (global) Width of the label in px
label_background inherited (global) Background color of the label. The color should be given in hexcode. Can also be "transparent".
label_border inherited (global) Border color of the labels. The color should be given in hexcode. Can also be "transparent".
line_type Specifies the type of line when view_type=line. Valid values are "11" for lines with one arrow at the end of a line and "10" for lines with two arrows pointing to each other in the middle of the line.
line_width 3 This defines the width of the line when this object is being displayed as line.
only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
url URL where the Icon should link to. Default link is to the Nagios CGIs. Available macros: [servicegroup_name], [htmlcgi] and [htmlbase].New in 1.4: The value can be empty to disable the link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name]
use Comma separated list of object templates to use. For details see template objects
view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines. (New in 1.4)
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1.

Map

Example with all options which have to be set (note that options already defined in the global section are optional):

define map {
 map_name=webserver
 x=77
 y=156
}
Value Default Description
map_name Name of the NagVis map cfg file (without .cfg extension)
x X axis coordinate
y Y axis coordinate
context_menu inherited (nagvis.ini.php) Enable/Disable the context menu for this object. (New in 1.4)
context_templateinherited (nagvis.ini.php)Context template for this object. (New in 1.4)
hover_menu inherited (nagvis.ini.php) Enable/Disable the hover menu
hover_url URL which should be displayed in hover menu instead of standard information. There are some macros available:
[map_name]: This macro stands for the object name.
hover_template inherited (global) Hover template for this object
hover_timeout inherited (nagvis.ini.php) Hover menu ajax request timeout in seconds for this object
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
hover_childs_show inherited (nagvis.ini.php) Enable/Disable displaying child objects
hover_childs_sort inherited (nagvis.ini.php) Sort method of child objects
hover_childs_order inherited (nagvis.ini.php) Order direction of child objects
hover_childs_limit inherited (nagvis.ini.php) Number of maximum children to be displayed. Set to -1 to disable the limit.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
label_show inherited (global) Enable/Disable label for this object
label_text [name] Text of the label. Available macros: [name], [alias], [output]
label_x inherited (global) Label X-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with prefix + or - relative to the upper left corner of the icons, otherwise absolute position)
label_width inherited (global) Width of the label in px
label_background inherited (global) Background color of the label. The color should be given in hexcode. Can also be "transparent".
label_border inherited (global) Border color of the labels. The color should be given in hexcode. Can also be "transparent".
line_type Specifies the type of line when view_type=line. Valid values are "11" for lines with one arrow at the end of a line and "10" for lines with two arrows pointing to each other in the middle of the line.
line_width 3 This defines the width of the line when this object is being displayed as line.
only_hard_states inherited (global) Sets whether soft states should be ignored. Default setting is 0.
url URL where the Icon should link to. Default link is to the Nagios CGIs. Available macros: [map_name], [htmlcgi] and [htmlbase]. New in 1.4: The value can be empty to disable the link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window). Available macros: [name]
use Comma separated list of object templates to use. For details see template objects
view_type icon This option defines the type of view for this object. Possible values are: "icon" or "line". Before NagVis 1.4 you could change the view of an object by setting the line_type. Since NagVis 1.4 you need to set the view_type for changing icons to lines. (New in 1.4)
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1.

Textbox

Example with all possible options:

define textbox {
  text="This is an informational text which can be placed anywhere on the map, HTML can also be used for formatting purposes"
 x=200
 y=100
 w=200
}
Value Default Description
text Your own text, HTML is possible. There are some macros:
[refresh_counter]: Shows the time until the next reload/rotate dynamically
[worker_last_run]: Shows the time of the last worker run
w Width of the textbox in px (pixels). Set to "auto" for auto scaling.
x X axis coordinate
y Y axis coordinate
background_color #C0C0C0 Background color of the textbox. The color should be given in hexcode. Can also be "transparent".
border_color #000000 Background color of the textbox. The color should be given in hexcode. Can also be "transparent".
use Comma separated list of object templates to use. For details see Template
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1.

Shape

Example with all values which have to be set:

define shape {
 icon="test"
 x=200
 y=100
}
Value Default Description
icon Filename of the shape. Shapes have to be located in the shape directory (default: nagvis/images/shapes)
x X axis coordinate
y Y axis coordinate
enable_refresh 0 This option activates the shape for regular updates in the frontend. This is only needed for dynamic shape images which change once in a while. (New in 1.4)
hover_menu 0 Enable/Disable the hover menu (New in 1.4)
hover_url URL which should be displayed when hovering over the image. By default there is no action on hover.
hover_delay inherited (nagvis.ini.php) Delay of hover menu appearance in seconds
url URL where the Icon should link to. By default there is no link. New in 1.4: The value can be empty to disable the link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
use Comma separated list of object templates to use. For details see Template
z 1 The z option defines the order of icons which are stacked on top of each other. The highest value will be displayed on top. The background image has the value of 0. So valid values should be above or equal 1

Template

In NagVis 1.2 there is a new object type named template. With this object you have the ability to define all values except the must-have-attributes in one object for many others. You can set all attributes to the value you need and inherit them with the use attribute to each object.

At the moment the template objects have to be defined directly in the files, the WUI doesn't support it. Maybe it'll be added in following versions.

Example with all values which have to be set:

define template {
 name=generic-template
}
Value Default Description
name Template name (simple string without space - has to be unique within the map)
... All values which are available in the objects which inherit this template