NagVis Map Configuration Format Description

General Informations

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

Configuration statements are started by the keyword “define” followed by a type field and an open bracked ({). Every following line defines variable-value pairs, separated by a ( = ) until a closed bracked (}) is found.

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

Description of the object types

Global

The first definition in every config file should be of the special type “global”. Options wich are defined at this paragraph are vaild 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_user Commata separated list of Nagios users wich are allowed to view this map
allowed_for_config Commata separated list of Nagios users wich are allowed to edit this map
map_image The map image displayed in the background of the NagVis map, for example a Visio (TM) drawing.
backend_id inherited (config.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.
recognize_services inherited (config.ini.php) Sets wether the states of the services on hosts, hostgroup objetcs should be recognized. If this is not given in the config it’s set to 1.
only_hard_states inherited (config.ini.php) Sets wether soft states should be ignored. Default setting is 0.
iconset inherited (config.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 wich means an OK state will display using “std_small_ok.png”, a CRITICAL state will be display by using “std_small_critical.png” and so on.
background_color inherited (config.ini.php) Background color of this map. If this is not set backgroundcolor from Main Configuration file is taken.
usegdlibs inherited (config.ini.php) Activates the usage of GD-Libs on this map (lines can only be used if GD-Libs are activated)
header_template inherited (config.ini.php) header template to be used on ths map
hover_template inherited (config.ini.php) Default hover template to be used on this map
hover_delay inherited (config.ini.php) Delay of hover menu appearance in seconds
show_in_lists inherited (config.ini.php) Show the maps in lists (dropdowns,index page,…)
label_show 0 Enable/Disable labels for the maps objects
label_x -20 Default x-Position of the labels in px (with presign + 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 presign + 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
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)

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
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.
recognize_services inherited (global) Defines if the services of the host affect the displayed state. If set to “1” a cricial 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.
only_hard_states inherited (global) Sets wether soft states should be ignored. Default setting is 0.
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.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
url URL where the Icon should link to. Default link is to the Nagios CGIs.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
hover_url URL which should be displayed in hover menu instead of standard Informations.
hover_template inherited (global) Hover template for this object
hover_delay inherited (config.ini.php) Delay of hover menu appearance in seconds
line_type If this is set, the object will be displayed as line.
label_show inherited (global) Enable/Disable label for this object
label_text [name] Text of the label
label_x inherited (global) Label X-Position (with presign + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with presign + 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

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
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.
only_hard_states inherited (global) Sets wether soft states should be ignored. Default setting is 0.
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.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
url URL where the Icon should link to. Default link is to the Nagios CGIs.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
hover_url URL which should be displayed in hover menu instead of standard Informations
hover_template inherited (global) Hover template for this object
hover_delay inherited (config.ini.php) Delay of hover menu appearance in seconds
line_type If this is set, the object will be displayed as line.
label_show inherited (global) Enable/Disable label for this object
label_text [name] [service_description] Text of the label
label_x inherited (global) Label X-Position (with presign + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with presign + 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

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
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.
recognize_services inherited (global) Defines if the services of the hosts affect the displayed state. If set to “1” a cricial 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.
only_hard_states inherited (global) Sets wether soft states should be ignored. Default setting is 0.
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.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
url URL where the Icon should link to. Default link is to the Nagios CGIs.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
hover_url URL which should be displayed in hover menu instead of standard Informations
hover_template inherited (global) Hover template for this object
hover_delay inherited (config.ini.php) Delay of hover menu appearance in seconds
line_type If this is set, the object will be displayed as line.
label_show inherited (global) Enable/Disable label for this object
label_text [name] [service_description] Text of the label
label_x inherited (global) Label X-Position (with presign + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with presign + 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

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
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.
only_hard_states inherited (global) Sets wether soft states should be ignored. Default setting is 0.
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.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
url URL where the Icon should link to. Default link is to the Nagios CGIs.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
hover_url URL which should be displayed in hover menu instead of standard Informations
hover_template inherited (global) Hover template for this object
hover_delay inherited (config.ini.php) Delay of hover menu appearance in seconds
line_type If this is set, the object will be displayed as line.
label_show inherited (global) Enable/Disable label for this object
label_text [name] [service_description] Text of the label
label_x inherited (global) Label X-Position (with presign + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with presign + 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

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 extionsion)
x X axis coordinate
y Y axis coordinate
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.
only_hard_states inherited (global) Sets wether soft states should be ignored. Default setting is 0.
iconset inherited (global) Special iconset. Is inherited from global paragraph if not specified.
url URL where the Icon should link to. Default link is to the Nagios CGIs
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
hover_url URL which should be displayed in hover menu instead of standard Informations
hover_template inherited (global) Hover template for this object
hover_delay inherited (config.ini.php) Delay of hover menu appearance in seconds
label_show inherited (global) Enable/Disable label for this object
label_text [name] [service_description] Text of the label
label_x inherited (global) Label X-Position (with presign + or - relative to the upper left corner of the icons, otherwise absolute position)
label_y inherited (global) Label Y-Position (with presign + 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

Textbox

Example with all possible options:

define textbox {
  text="This is an informative text wich is free placeable on the map, HTML can also used for formating purposes"
  x=200
  y=100
  w=200
}
Value Default Description
text Your own text, HTML is possible
w With of the textbox
x X axis coordinate
y Y axis coordinate
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.
background_color #C0C0C0 Background color of the textbox, can also be transparent

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
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
url URL where the Icon should link to. By default there is no link.
url_target _self Target of the Icon link, this option adapts <a target=""> (_self is same window)
hover_url URL which should be displayed when hovering over the image. By default there is no action on hover.