See www.zabbix.com for the official Zabbix site.

Docs/specs/ZBXNEXT-734

From Zabbix.org
Jump to: navigation, search

Support URL as dynamic screen item

ZBXNEXT-734

Status: v1.2

Owner: Alexei, Sasha

Summary

Currently screen element URL cannot be made dynamic. It should be improved.

Specification

Macros to be supported for screen element Url in field URL:

  • {HOST.CONN}
  • {HOST.DNS}
  • {HOST.ID}
  • {HOST.IP}
  • {HOST.HOST}
  • {HOST.NAME}
  • {$MACRO}

Examples:

 URL: http://wiki.company.com?hostname={HOST.HOST}
 URL: http://kb.company.com?hostid={HOST.ID}
 URL: {$URL}

If a user macro {$MACRO} contains another macro, the latter macro will not be expanded.

Details

Configuration

When editing global screen elements of type 'URL' a new field will be available:

 Dynamic item [ ]  # last field

When previewing the URL element on the screen configuration page, the frontend will try to open the page without resolving macros.

The functionality will be supported by host-level screens as well.

Monitoring

Opening a host screen in the monitoring section will display the URL element with resolved macros.

Opening a global screen with a dynamic URL element will display the host selection dropdown the same way as for other dynamic items. The first dropdown entry will be renamed from "Default" to "not selected". If no host is selected, instead of displaying the element, the frontend will display a "No host selected." message instead.

If "Dynamic item" was not selected for screen element, only global macros will be expanded.

API changes

No API changes.

Translation strings

New string:

  • No host selected.

Documentation

  • What's new in 2.4
  • Screen related documentation
  • Macros supported by location

Also discussed

  • Macros like {HOST.PORT}, {INVENTORY.*} and {HOSTGROUP.ID} will not be supported due to very limited usefulness.
  • We won't try to disable URL element preview in screen configuration since it's difficult to determine, whether the URL contains macros.

ChangeLog

  • v1.1
    • The functionality will be supported by host-level screens.
  • v1.2
    • Added more details about displaying dynamic screen items when no host is selected.