NagVis 1.2 Template Format Description

Header templates

Header templates are html files with some macros in it. These files can be used as header menu in the maps. The header templates are located in nagvis/etc/templates/header/ relative to the nagvis root directory. The templates are named like this: tmpl.*.html.

Currently aviable macros
Macro Description
[current_map] Name of the current map (e.g. demo,demo2)
[current_map_alias] Alias of the current map


[map_name]

A list of all defined maps in NagVis. The code between

and

is repeated for each map. For an example have a look at nagvis/etc/templates/header/tmpl.default.html.

Within the BEGIN/END-Tags the following macros are aviable:
* [map_name]: Name of the map
* [map_alias]: Alias of the map
* [selected]: If the mapname is equal to the currently opened map it will be replaced with selected="selected"
[html_base] URL to HTML-Base (/nagios/nagvis)
[html_templates] Path to header templates (nagvis/nagvis/etc/templates/header)
[html_template_images] Path to header template images (nagvis/nagvis/images/templates/header)
[lang_select_map] Label for map selection
[lang_edit_map] Label for edit map link
[lang_need_help] Label for help selection
[lang_online_doc] Label for link to online documentation
[lang_forum] Label for link to NagVis forum
[lang_support_info] Label for link to support informations
[lang_overview] Label for overview string
[lang_instance] Label for instance string
[lang_rotation_start] Label for starting the map rotation
[lang_rotation_stop] Label for stopping the map rotation

Hover templates

Hover templates are html files with some macros in it. These files can be used as hover menus for the objects on the maps. The hover templates are located in nagvis/etc/templates/hover/ relative to the nagvis root directory. The templates are named like this: tmpl.*.html.

Currently aviable macros
Macro Description
[obj_type] Type of object (host,service,hostgroup,...)
[obj_name] Name of object (hostname,hostgroupname,servicegroupname,mapname,...)
[service_description] Service description in Nagios (only if object-type is service)
[obj_state] State of object (OK,WARNING,CRITICAL,...)
[obj_backendid] Gets the backend id of the objects backend (backend_<*>)
[obj_backend_instancename] Gets the NDO instance name of the objects backend. (Only aviable with NDO backend)
[obj_output] Output for this object
[lang_obj_type] Label for object type
[lang_name] Label for object name
[lang_state] Label for object state
[lang_output] Label for object output
[lang_overview] Label for overview
[lang_instance] Label for instance string
[html_base] URL to HTML-Base (/nagios/nagvis)
[html_templates] Path to hover templates (nagvis/nagvis/etc/templates/hover)
[html_template_images] Path to hover template images (nagvis/nagvis/images/templates/hover)
[pnp_hostname] Hostname with replaces blanks for PNP
[pnp_service_description] Service Description with replaces blanks for PNP