Datasources

Tokens Available for Data Collection

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, in seconds, as defined in either the DataSource definition or in the custom properties of a device or device 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.
  • ##Device Property##. Any of the properties associated with a device are available as tokens.

For example, consider this collector attributes section of the MySQL DataSource:

This uses many tokens to create a flexible DataSource:

  • the device name of the node that collection is occurring on is subsituted 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 to connect as are substituted for ##jdbc.mysql.user## and ##jdbc.mysql.pass## (which is the contents of the password field.)

Thus when an actual collection instance runs, the actual url used 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.