NagVis Map Configuration Format Description

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 single types in detail

Global

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.

Service - Display one single 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.
hover_url URL which should be displayed in hover menu instead of standard Informations
url URL where the Icon should link to. Default link is to the Nagios CGIs.

Host - Display one single 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.
hover_url
url URL where the Icon should link to. Default link is to the Nagios CGIs.
line_type URL which should be displayed in hover menu instead of standard Informations

Hostgroup - Display the worsest state of a 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.
hover_url URL which should be displayed in hover menu instead of standard Informations

Servicegroup - Display the worsest state of a 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.
hover_url URL which should be displayed in hover menu instead of standard Informations
line_type

Map - Display the worsest state of another NagVis 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.
hover_url URL which should be displayed in hover menu instead of standard Informations

Textbox - Draw a textfield on the map

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