Hover Templates

Introduction

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. There are macros which are available in hover menus of all object types and some which are only available for some special objects. All standard macros are listed below.

General

The following macros are available in hover menus of all object types:
Macro Description
General
[obj_type] Type of the object (host, service, hostgroup, ...)
[obj_name] Name of the object (hostname, hostgroupname, servicegroupname, mapname,...)
[obj_alias] Alias of the object (If no alias is defined it is equal with [obj_name])
[obj_display_name] Display name of the object
[obj_state] State of the object (OK, WARNING, CRITICAL,...)
[obj_summary_state] Merged state of the object and all child objects (OK, WARNING, CRITICAL, ...)
[obj_acknowledged] When the state is acknowledged the macro is replaced with "(Acknowledged)"
[obj_summary_acknowledged] When the summary state is acknowledged the macro is replaced with "(Acknowledged)"
[obj_in_downtime] When the object is currenty in a downtime this macro is replaced with "(In Downtime)"
[obj_summary_in_downtime] When the object is currenty in a downtime this macro is replaced with "(In Downtime)"
[obj_output] Output for this object
[obj_summary_output] Summary output of the object
Language macros
[lang_name] Label for the object name
[lang_child_name] Label for the child object names
[lang_alias] Label for the object alias
[lang_address] Label for the object address
[lang_state] Label for the object state
[lang_obj_type] Label for the object type
[lang_summary_state] Label for the summary state
[lang_output] Label for the output
[lang_summary_output] Label for the summary output
[lang_overview] Label for the overview
[lang_instance] Label for the NDO instance
[lang_next_check] Label for the next check of the object
[lang_last_check] Label for the last check of the object
[lang_current_attempt] Label for the current attempt
[lang_last_state_change] Label for the last state change
[lang_state_duration] Label for the state duration
[lang_service_description] Label for the service description
[lang_notes]Label for the object notes
Paths
[html_base] Absolute URL to HTML-Base (/nagios/nagvis)
[html_templates] Path to hover templates directory (nagvis/nagvis/etc/templates/hover)
[html_template_images] Path to hover template images directory (nagvis/nagvis/images/templates/hover)

Special macros

There are macros for hover templates of a specified type. These macros should be surrounded by section macros. The section macros define that the included code will be removed if the hover template is not parsed for this type. For example a section macro for host macros looks like this: <!-- BEGIN host -->.+?<!-- END host --> Below you can find a full list of the special macros

All exception map objects

Macro Description
[obj_backendid] The backend-id of the objects backend (backend_<*>)
[obj_backend_instancename] The NDO instance name of the objects backend

Host/Service objects

Macro Description
[obj_address] The address of the host object
[obj_last_check] The date and time of the last check of this object. The datetime is printed in the defined dateformat.
[obj_next_check] The date and time of the next check of this object. The datetime is printed in the defined dateformat.
[obj_state_type] The current state type (HARD/SOFT)
[obj_current_check_attempt] The number of the current check attempt
[obj_max_check_attempts] The number of the maximum check attempts
[obj_last_state_change] The date and time of the last state change. The datetime is printed in the defined dateformat.
[obj_last_hard_state_change] The date and time of the last hard state change. The datetime is printed in the defined dateformat.
[obj_state_duration] The duration of the current state
[obj_notes]The configured notes of the host or service objects

Service objects

Macro Description
[service_description] Service description in Nagios
[pnp_hostname] Hostname with replaced blanks for links to PNP images
[pnp_service_description] Service description with replaced blanks for links to PNP images

Host objects

Macro Description
[pnp_hostname] Hostname with replaced blanks for links to PNP images

Servicegroup objects

There is a very special macro for the child services of a servicegroup, this is the selection macro <!-- BEGIN servicegroup_child --><!-- END servicegroup_child -->.
Macro Description
[lang_child_name1] Label for the host name of the child service
[obj_name1] Hostname for the child service