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!
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 (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. |
recognize_services | inherited (nagvis.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 (nagvis.ini.php) | Sets wether soft states should be ignored. Default setting is 0. |
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 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 (nagvis.ini.php) | Background color of this map. If this is not set backgroundcolor from Main Configuration file is taken. |
usegdlibs | inherited (nagvis.ini.php) | Activates the usage of GD-Libs on this map (lines can only be used if GD-Libs are activated) |
header_template | inherited (nagvis.ini.php) | header template to be used on ths map |
hover_template | inherited (nagvis.ini.php) | Default hover template to be used on this map |
hover_delay | inherited (nagvis.ini.php) | Delay of hover menu appearance in seconds |
show_in_lists | inherited (nagvis.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 (_self is same window) |
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 (_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 (nagvis.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 |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
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 (_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 (nagvis.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 |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
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 (_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 (nagvis.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 |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
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 (_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 (nagvis.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 |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
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 (_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 (nagvis.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 |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
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. There is one macro [refresh_counter], it shows the time to the next reload/rotate dynamicaly. (New in 1.2) | |
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 |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
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 (_self is same window) |
hover_url | URL which should be displayed when hovering over the image. By default there is no action on hover. | |
use | Coma seperated list of object templates to use. For details see [[#template]] (New in 1.2) |
In NagVis 1.2 there is a new object type named template
. With this object you have the possibility to define all values expect 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 in the map) | |
... | All values which are aviable in the objects which inherit this tempalte |