Tokens Available for Data Collection

Last updated on 20 March, 2023

Overview

The following tokens are available for use in the Collector Attributes, Active Discovery and Datapoints sections of every DataSource definition:

  • ##HOST##. The naming convention by which your device was added into monitoring (ie IP, DNS, or system name).
  • ##HOSTNAME##. The name of the device that collection is being applied to.
  • ##AGENTROOT##. The file system path to where the collector was installed.
  • ##LIBPATH##. The path to the “lib” directory of the collector, where external scripts are typically stored.
  • ##JAVAHOME##. The path to the java binary that the collector is using.
  • ##POLLINTERVAL##. The polling period (i.e. collection interval), in seconds, as defined in either the DataSource definition or in the custom properties of a resource or resource group (if a custom value has been created to override the DataSource default).
  • ##WILDVALUE##. The unique identifier of each instance of a multi-instance DataSource, as reported by Active Discovery or created manually. For example, the Name property of a member of a WMI class, or the unique index on an snmp object in a tree.
  • ##WILDALIAS##. The descriptive identifier of each instance of a multi-instance DataSource.
  • ##RESOURCEPROPERTYNAME##. Any of the properties associated with a device/resource are available as tokens.

Token Usage Example

For example, consider this Collector Attributes section of the MySQL DataSource:

This configuration area uses many tokens to create a flexible DataSource:

  • The device name of the node that collection is occurring on is substituted for ##HOSTNAME##
  • Each port that MySQL was found to be listening on by Active Discovery is substituted for ##WILDVALUE##, as each instance is collected.
  • The database name that the collection should occur against is substituted for ##DBNAME##. This can be set globally, then overridden for groups and devices as needed.
  • The user/password used to access the database are substituted for ##jdbc.mysql.user## and ##jdbc.mysql.pass## (which represent the contents of the password field.)

Thus, when a collection instance runs, the rendered URL will be something like:

jdbc:mysql://testbase.mycompany.com:3306/testdb, and the username and password used will be those properties set on, or inherited by, this specific host.

In This Article